highcharts / export-csv

Highcharts plugin to export chart data to CSV
http://www.highcharts.com/plugin-registry/single/7/Export-CSV
MIT License
76 stars 95 forks source link

Remove html tags from x-axis categories #130

Closed BonsaiCode closed 7 years ago

BonsaiCode commented 7 years ago

FYI, some of my charts have html in its x axis categories so I made the following change to my copy of your plugin to remove the html when exporting to csv...

line 166: old line: xAxis.categories[row.x], new line: $('<div/>').html( xAxis.categories[row.x] ).text(), // strip html from the label

Thanks for the great plugin!

TorsteinHonsi commented 7 years ago

Thanks for the suggestion!

However, we don't want to depend on jQuery in our code base. Also, best practice is to keep your categories clean from markup, and rather add markup in the formatters for axis label, tooltip etc.

BonsaiCode commented 7 years ago

I see, that makes sense. I am making weekend dates in my xaxis categories a different color w/html. I'll try moving that logic from server side to the client-side formatter. Thanks