Go to http://jsfiddle.net/cqjvD/1069/ (or any export-csv enabled chart with a series that has the "#" character in the name)
Click "Download CSV" from the drop-down menu
Examine the CSV - the data is blank
Source:
The source of this issue seems to be in Highcharts.Chart.prototype.downloadCSV, when passing 'data:text/csv,' + csv.replace(/\n/g, '%0A'), as the href param.
Proposed solution:
Add .replace(/#/g, '%23') to encode the "#" character. Encoding the string could also be passed off to a new function that could encode all the special characters at once, not just newlines and "#".
To reproduce:
Source:
The source of this issue seems to be in
Highcharts.Chart.prototype.downloadCSV
, when passing'data:text/csv,' + csv.replace(/\n/g, '%0A'),
as thehref
param.Proposed solution:
Add
.replace(/#/g, '%23')
to encode the "#" character. Encoding the string could also be passed off to a new function that could encode all the special characters at once, not just newlines and "#".