anselmic
Posts: 5
Joined: Tue Nov 23, 2021 12:37 am

Highcharts export csv - choose data displayed

Hi,

I have a stacked chart, where I need to use the delta of the current value and the last value in the series.
in the tooltip I show the absolute values using 'point.absoluteValue' .

This works very good. But in the csv export the delta values are shown.

How can I change the values of the csv export so the absolute values are shown and not the delta values.

Thank you for your help.
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Highcharts export csv - choose data displayed

Hello anselmic,

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

I need some more informations about chart config etc. Please try to recreate your chart in a form of a simplified live demo. You can start here: https://jsfiddle.net/BlackLabel/mbao0gsL/

Regards!
Mateusz Bernacik
Highcharts Developer
anselmic
Posts: 5
Joined: Tue Nov 23, 2021 12:37 am

Re: Highcharts export csv - choose data displayed

Hi mateusz.b,

thank you for your answer and your help.

I added it https://jsfiddle.net/anselmscholz/fjt5w7yu/

Does this help?

Regards
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Highcharts export csv - choose data displayed

Hello anselmic,

Yes, it helped a lot. Unfortunately it is not possible to do these changes from API level, you need to change code and wrap a function responsible for creating csv table. I have created such wrap for you. You can find it here: https://jsfiddle.net/BlackLabel/vsj2eLg9/

More about extending Highcharts: https://www.highcharts.com/docs/extendi ... highcharts

Let me know if that was what you were looking for!
Regards!
Mateusz Bernacik
Highcharts Developer
anselmic
Posts: 5
Joined: Tue Nov 23, 2021 12:37 am

Re: Highcharts export csv - choose data displayed

Hello mateusz.b,

Thank you very much, thats exactly what I was looking for.

I will try to implement it in my rails app, with lazyhighcharts :-)

Regards

Anselm
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Highcharts export csv - choose data displayed

Hi anselmic,

You're welcome! In case of any further questions, feel free to contact us again.

Regards!
Mateusz Bernacik
Highcharts Developer
anselmic
Posts: 5
Joined: Tue Nov 23, 2021 12:37 am

Re: Highcharts export csv - choose data displayed

Hi mateusz.b,

I got it working in my web app, but I am struggling with the default charts, is there a way to use the default when 'toolTipValue' is missing?, some kind of a fallback?

Regards

Anselm
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Highcharts export csv - choose data displayed

Hello anselmic,

This can be solved in multiple ways but my suggestion is to create a custom property on exporting options which would tell if toolTipValue or defaul y value should be used. Then you would use that property in wrapped function as a flag in a conditional statement.
Demo (check lines 98 and 324): https://jsfiddle.net/BlackLabel/29vdwrn3/
If you want to create a table with toolTipValue again then simply set customKey value to true.

In the example it works as a simple boolean flag but in can be slightly modified for cases where you have multiple custom keys for your export.

Let me know if that solution works for you.
Regards!
Mateusz Bernacik
Highcharts Developer
anselmic
Posts: 5
Joined: Tue Nov 23, 2021 12:37 am

Re: Highcharts export csv - choose data displayed

Hello mateusz.b,

thank you so much, its perfect :-)

Best wishes

Anselm
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Highcharts export csv - choose data displayed

anselmic,

You're welcome! I'm glad to hear it works fine. As always in case of any further questions feel free to contact me again.

Regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Usage”