ksriramaddteq
Posts: 1
Joined: Tue Aug 02, 2022 8:23 pm

Export highchart in XLSX format

I am looking for an option to export highchart in XLSX format along with data and chart UI. I see a lot of posts that help to export in XLSX with data but the chart itself is missing.

Is it possible to achieve this? Are there any 3rd party libraries that provide this functionality?
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Export highchart in XLSX format

Hi ksriramaddteq!
Welcome to our forum and thanks for contacting us with your question!

Actually, it is not possible to achieve that straight from the API level, in order to get such functionality you need to use a 3rd party plugin. Here is the official demo of XLSX Export using this plugin: https://jsfiddle.net/gh/get/library/pur ... data/xlsx/

There is also a GitHub ticket with a discussion about XLSX, you can find it here: https://github.com/highcharts/highcharts/issues/14240

The demo above is exporting only data because you can't export data to XLS/XLSX along with the chart. The only option is to use export twice, one to export data from the chart and the second to export PNG (image) of the chart.

Feel free to ask any further questions.
Kind regards!
Hubert Kozik
Highcharts Developer
juncheol
Posts: 1
Joined: Thu Dec 08, 2022 7:45 am

Re: Export highchart in XLSX format

plz check my Code
I saw your https://jsfiddle.net/gh/get/library/pur ... data/xlsx/
and I copy and pasted on my visual studio
but it's not working still working as downloadXLS

I wonder how to use code in the view and if there are things that need to be installed.
I would appreciate your reply.
hubert.k
Posts: 1164
Joined: Mon Apr 11, 2022 11:48 am

Re: Export highchart in XLSX format

Hi juncheol!
Welcome to our forum and thanks for contacting us with your question!

Everything that is included in the demo you have attached is necessary to have a working export of the chart in XLSX format. You have to include the following:
- Highcharts library
- HC Exporting Module
- HC Export Data Module
- zipcelx which is a non-Highcharts dependency for exporting to XLS and XLSX. It is licenced under the MIT license, see https://github.com/egeriis/zipcelx/blob/master/LICENSE

Then you have to include the plugin, which is wrapped by the IIFE function in the JavaScript tab.

Regards!
Hubert Kozik
Highcharts Developer

Return to “Highcharts Usage”