diff --git a/src/assets/wise5/components/graph/graph-student/graph-student.component.ts b/src/assets/wise5/components/graph/graph-student/graph-student.component.ts index ca633e8d13b..26cddbfc500 100644 --- a/src/assets/wise5/components/graph/graph-student/graph-student.component.ts +++ b/src/assets/wise5/components/graph/graph-student/graph-student.component.ts @@ -399,7 +399,12 @@ export class GraphStudent extends ComponentStudent { studentData.tableData, this.value ); - if (textValue !== '' && isNaN(parseFloat(textValue))) { + if ( + typeof textValue === 'string' && + textValue !== '' && + !thisComponent.isNA(textValue) && + isNaN(parseFloat(textValue)) + ) { return studentData.tableData[this.value + 1][studentData.dataExplorerSeries[0].xColumn] .text; } @@ -409,6 +414,11 @@ export class GraphStudent extends ComponentStudent { }; } + isNA(text: string): boolean { + const textUpperCase = text.toUpperCase(); + return textUpperCase === 'NA' || textUpperCase === 'N/A'; + } + getXColumnTextValue(dataExplorerSeries: any[], tableData: any[][], value: number): string { const xColumn = dataExplorerSeries[0].xColumn; const dataRow = tableData[value + 1];