nliles
Posts: 7
Joined: Thu Aug 30, 2018 9:11 pm

Highcharts export menu option

I recently switched from highcharts to highstock. I realized that the default options for export are different and no longer include 'download CSV'. I want to customize my menu options to keep all default options except for print chart and to also add download CSV. I have customized the menu options this way:

Code: Select all

  exporting: {
        buttons: {
          contextButton: {
            menuItems: ['downloadPNG', 'downloadJPEG', 'downloadPDF', 'downloadSVG'],
          },
        },
   }
I now want to add the downloadCSV option. I tried a few examples I saw online but couldn't get this to work. What is the best way to do this?
wojtek
Posts: 433
Joined: Tue Jul 03, 2018 12:32 pm

Re: Highcharts export menu option

Hi nliles,

Have you attached export data module to your app? This module is required to enable exporting the chart data to CSV, XLS or HTML table formats.

You should have this file attached to have all export options:

Code: Select all

<script src="https://code.highcharts.com/stock/highstock.js"></script>
<script src="https://code.highcharts.com/stock/modules/exporting.js"></script>
<script src="https://code.highcharts.com/stock/modules/export-data.js"></script>
Docs reference:
https://www.highcharts.com/docs/export- ... e-overview

Api referecne:
https://api.highcharts.com/highcharts/exporting.csv

Kind regards.
Wojciech Chmiel
Highcharts Developer

Return to “Highcharts Stock”