Updated report system to analyse subsets

This commit is contained in:
2025-06-01 20:46:42 +01:00
parent 7d571d240d
commit bf17427cc4
8 changed files with 84 additions and 21 deletions

View File

@@ -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;