Settings and activity
1 result found
-
68 votes
Here’s a small plugin for getting the CSV for a categorized chart:
An error occurred while saving the comment An error occurred while saving the comment Mathew Weaver commentedI am looking to do the same thing that you describe. Did you ever get any further with this? Would you mind sharing a code snippet that gets the viewable chart data into a data URI?
Mathew Weaver supported this idea ·
As Josh said, getting the viewable chart data is fairly easy. Here is a code snippet:
var csv = "";
for (var i = 0; i < chart.series.length; i++) {
if (chart.series[i].name == 'Navigator') continue;
var series = chart.series[i];
for (var j = 0; j < series.data.length; j++) {
if (series.data[j] != undefined && series.data[j].x >= series.xAxis.min && series.data[j].x <= series.xAxis.max) {
csv = csv + series.name + ',' + Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', series.data[j].x) + ',' + series.data[j].y + '\r\n';
}
}
}