root page chart table javascript playground wip

This commit is contained in:
DeltaLima 2025-04-10 02:16:55 +02:00
parent 64e39dcd85
commit 57f704ef28

View file

@ -340,8 +340,14 @@ function DrawChart() {
row[i] = table.insertRow(i);
var cell = [];
for(let j = 0; j < chartSum; j++) {
cell[j] = row[i].insertCell(j);
cell[j].innerHTML = ChartJson.chart[j].data[i];
/* check if data is present */
if((ChartJson.chart[j].hasOwnProperty('data')) && (ChartJson.chart[j].data[i] != "undefined")) {
cell[j] = row[i].insertCell(j);
cell[j].innerHTML = ChartJson.chart[j].data[i];
} else {
console.log('Chart ID ' + j + 'does not have any data')
}
}
}