Updated report system to analyse subsets
This commit is contained in:
10
drawbar.js
10
drawbar.js
@@ -28,8 +28,8 @@ SOFTWARE.
|
||||
|
||||
|
||||
function drawBar(id,data) {
|
||||
console.log(id);
|
||||
console.log(data);
|
||||
//console.log(id);
|
||||
//console.log(data);
|
||||
const svg = d3.select(`${id}`);
|
||||
const backgroundwidth = +svg.attr("width");
|
||||
const backgroundradius = 10;
|
||||
@@ -297,7 +297,7 @@ function doBarData(id,qid, survey, Q1=0, Q2=0, Q3=0 ) {
|
||||
.then(response => response.text())
|
||||
.then(data => {
|
||||
// Output result
|
||||
console.log(data);
|
||||
//console.log(data);
|
||||
const parsed = JSON.parse(data);
|
||||
|
||||
// 2. Clean the keys and build a usable object
|
||||
@@ -308,9 +308,9 @@ function doBarData(id,qid, survey, Q1=0, Q2=0, Q3=0 ) {
|
||||
bardata[cleanKey] = entry[rawKey];
|
||||
});
|
||||
|
||||
console.log(bardata);
|
||||
//console.log(bardata);
|
||||
const total = Object.values(bardata).reduce((sum, value) => sum + value, 0);
|
||||
console.log(total);
|
||||
//console.log(total);
|
||||
document.getElementById("record_no").textContent = total;
|
||||
if (total < 9){
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user