midiman
Posts: 1
Joined: Wed Oct 27, 2021 3:18 am

Post render JavaScript manipulation options

Newb question:

Once a chart is rendered, what is the best approach to manipulating the data or other aspects of the chart? My client thinks it can only be done by changing the data via a server script with changing the options via a round-trip back to the server if modifications need to be made.

Where's the client side JavaScript approach to this (if there is one?). I see lots of JS code example for creating the chart for first time render...what about post render?

Thanks in advance.
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Post render JavaScript manipulation options

Hello midiman,

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

Rendered chart and its elements can be altered in general with update() method. It's not the only option, because you can also use methods that add or remove data or even elements like axes.
Demo: https://jsfiddle.net/BlackLabel/ruL14gfa/
API reference: https://api.highcharts.com/class-refere ... art#update
https://api.highcharts.com/class-reference/classes.list

Let me know if that was what you were looking for!
Best regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Usage”