0

I have a question about highchart exporting. I need to use highchart own export and I wonder that I use another data series for exporting. For example;

series: [{
  type: 'pie',
  name: '',
  data: [<?=substr($data2,0,-1)?>],
  data: [<?=iconv("UTF-8","ISO-8859-9",substr($data2,0,-1))?>]
}

I want to use first data for view second data for export. How can I do that ?

icedwater
  • 4,701
  • 3
  • 35
  • 50
Yasin Yörük
  • 1,500
  • 7
  • 27
  • 51
  • Do you mean in exporting of the chart itself or in the actual data as in a CSV file? – wergeld May 23 '13 at 13:50
  • I mean, first data should be on the screen but the exporting data is coming from other variable. So this one is should be on screen `data: [=substr($data2,0,-1)?>]` and this one is should be exporting `data: [=iconv("UTF-8","ISO-8859-9",substr($data2,0,-1))?>]` – Yasin Yörük May 24 '13 at 06:24

2 Answers2

0

Have you seen exporting option? http://api.highcharts.com/highcharts#exporting.chartOptions

Sebastian Bochan
  • 37,348
  • 3
  • 49
  • 75
0

Here is a method that needs some extra work but should do the trick. What I did was set up a custom export button that first sets the series data to some other data string then it exports it as an image, then it sets the chart data back to its original values. Note that the first setData() call does not redraw the chart. This is so that we do not see the new data points. The second setData() call does redraw. I have not tested it with zooming or resetting other chart options so YMMV.

Example and Relevant code:

$(document).ready(function () {
    $('#clickme').click(function () {
        chart.series[0].setData(data2, false);
        chart.exportChart({type: "image/jpeg"});
        chart.series[0].setData(data1, true);
    });
});
wergeld
  • 14,332
  • 8
  • 51
  • 81