export-csv
export-csv copied to clipboard
export-csv.js - error with column, line and pie graph - Cannot read property '0' of undefined
When I used export-csv.js to export csv or excel file for highChart graph "column, line and pie graph", I was getting javascript error in "Transform the rows to CSV" part in this line "Highcharts.pick(xAxis.names[row.x], xAxis.categories[row.x], row.x)". This error happened because I do not have xAxis names in my case (xAxis.names was undefined).
I Fixed in locally by adding the below if condition.
if ( xAxis.names === undefined || xAxis.names === null) {
category = Highcharts.pick(xAxis.categories[row.x], row.x)
} else {
category = Highcharts.pick(xAxis.names[row.x], xAxis.categories[row.x], row.x)
}