Skip to content

Commit

Permalink
feat(Graph): Replace empty table values with NA string (#704)
Browse files Browse the repository at this point in the history
Co-authored-by: Jonathan Lim-Breitbart <breity10@gmail.com>
  • Loading branch information
geoffreykwan and breity authored Aug 5, 2022
1 parent eabd708 commit 19b94d5
Showing 1 changed file with 21 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ export class GraphStudent extends ComponentStudent {
this.xAxis.labels = {
formatter: function () {
if (
this.value < studentData.tableData.length &&
this.value + 1 < studentData.tableData.length &&
studentData.isDataExplorerEnabled != null &&
studentData.dataExplorerSeries != null &&
studentData.tableData != null
Expand Down Expand Up @@ -1707,25 +1707,29 @@ export class GraphStudent extends ComponentStudent {
}
}

addPointFromTableIntoData(xCell, yCell, data) {
addPointFromTableIntoData(xCell: any, yCell: any, data: any[]) {
let xText = xCell.text;
if (xText == null || xText === '') {
xText = 'N/A';
}
let yText = yCell.text;
if (xText != null && xText !== '' && yText != null && yText !== '') {
const xNumber = Number(xText);
const yNumber = Number(yText);
const point = [];
if (!isNaN(xNumber)) {
point.push(xNumber);
} else {
point.push(xText);
}
if (!isNaN(yNumber)) {
point.push(yNumber);
} else {
point.push(yText);
}
data.push(point);
if (yText == null || yText === '') {
yText = 'N/A';
}
const xNumber = Number(xText);
const yNumber = Number(yText);
const point = [];
if (!isNaN(xNumber)) {
point.push(xNumber);
} else {
point.push(xText);
}
if (!isNaN(yNumber)) {
point.push(yNumber);
} else {
point.push(yText);
}
data.push(point);
}

setSeriesIds(allSeries) {
Expand Down

0 comments on commit 19b94d5

Please sign in to comment.