djoshi
Posts: 71
Joined: Fri Mar 26, 2021 5:16 pm

CSV files

Hi

Is it possible based on what is being displayed on the plot, we can generate a CSV from from the High GUI?
andrzej.b
Site Moderator
Posts: 614
Joined: Mon Jul 15, 2024 12:34 pm

Re: CSV files

Hi there!

Yes, in Highcharts Stock, you can generate a CSV file from the data that's being displayed on the chart. This is done using the export module, which adds an "Export" button to the chart's context menu. When you select the CSV option, it will generate a CSV file based on the current data view.
As for the export server options, they are primarily used for generating image or PDF exports of the chart. The CSV export functionality, however, is handled entirely on the client side, so it doesn't require the export server. This means you can export your data to CSV without needing to send any data to a server, making it a straightforward and secure option.
If you need any more details or help setting this up, feel free to ask!

Kind regards,
Andrzej
Highcharts Developer
djoshi
Posts: 71
Joined: Fri Mar 26, 2021 5:16 pm

Re: CSV files

Hi, Can this work with the standard High Chart? Also, we are using the angular plugin for High Chart, is there angular plugin for the export?
andrzej.b
Site Moderator
Posts: 614
Joined: Mon Jul 15, 2024 12:34 pm

Re: CSV files

Hi,

Export module is available in every Highcharts product: Core, Stock, Maps, Gant, Dashboards, and it can be used in frameworks such as Angular, as any other Highcharts module, with no plugins needed. Just import it properly for your version of Higcharts - from v12 there is a change in import syntax described in the changelog, under “Upgrade notes”: https://www.highcharts.com/blog/changel ... ts-v12.0.0

Kind regards,
Andrzej
Highcharts Developer
djoshi
Posts: 71
Joined: Fri Mar 26, 2021 5:16 pm

Re: CSV files

Thanks!

I got it working. It's nice to see that there are multiple options for download formats.

I have two additional questions:

1. I have simply loaded the modules and called them from the constructor, and it’s working well. I did not need to modify the chart object using the `exporting` tag. Is this approach correct? I want to ensure there won’t be any issues in the future with different browsers or platforms.

2. At the moment, I am downloading the js files following files every time I load the plot page. Is that happening every time the page is loaded? Can I save these files locally for a faster process?
andrzej.b
Site Moderator
Posts: 614
Joined: Mon Jul 15, 2024 12:34 pm

Re: CSV files

Hi,

Thanks for the update.

Ad 1) Yes, your approach is correct. By including the exporting module, the default exporting options are automatically enabled, which is why you didn't need to modify the chart object with the exporting tag. This should work fine across different browsers and platforms, as the exporting module is designed to handle compatibility. However, keep in mind that some older browsers may require additional libraries for certain export formats, like PDFs.

Ad 2) If you're downloading the JS files from the Highcharts CDN every time the page loads, it can indeed slow down the process. You can host these files locally to improve load times. Simply download the necessary JS files (like exporting.js, offline-exporting.js, etc.) and include them in your project. Then, reference them locally in your HTML file. This way, the files are loaded from your server instead of being fetched from the internet each time.

If anything else pops up, please let us know.

Kind regards,
Andrzej
Highcharts Developer

Return to “Highcharts Stock”