Skip to content

Commit

Permalink
fix(Data Explorer): Fix x axis N/A tick label (#770)
Browse files Browse the repository at this point in the history
  • Loading branch information
geoffreykwan authored Aug 25, 2022
1 parent 772fc65 commit 43ee800
Showing 1 changed file with 11 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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];
Expand Down

0 comments on commit 43ee800

Please sign in to comment.