I am overriding getDataRows, in order to change the data before export to xls.
https://api.highcharts.com/class-refere ... etDataRows
My problem is that I have many charts on the page, and I want to be able to run a different function for each chart, however setting it once seems to effect all of them.
How do I set a different getDataRows per chart instead of universally? I am using Typescript with Angular, each chart is in a different angular component.
Code: Select all
Highcharts.Chart.prototype.getDataRows = (multiLevelHeaders) => {
var rows = [["Age Group", "Distrobution"]]
for (let i = 0; i < this.aggregatedData.length; i++) {
if (this.aggregatedData[i].ageGroup) {
rows.push([this.aggregatedData[i].ageGroup, this.aggregatedData[i].distribution.toString()])
}
}
return rows;
};
Also, as a separate note, this documentation here seems to say that exportData is called and intended for this purpose, however as far as I can tell, this never gets called during export to xls, and others on stackoverflow seem to acknowledge this inconsistency.
https://api.highcharts.com/highcharts/c ... exportData