fourmisz
Posts: 7
Joined: Mon Feb 01, 2016 10:31 am

update chart type stacked-areaspline to area

Hi. :D

I was trying to update chart type dynamically and i found unexpected action.

I wanted to change the chart type "stacked-areaspline" to "area".

And i expected to display area chart(this chart has shart points) but it kept displaying spline chart(this chart has soft points).

Is this the intended behavior?

You can see this action in here(https://jsfiddle.net/or4190em/).

Just press "update type to area" button and see what is happening.
bastss
Site Admin
Posts: 1208
Joined: Wed Oct 17, 2018 10:59 am

Re: update chart type stacked-areaspline to area

Hello fourmisz!

Check your code one more time carefully. In your code type property is written twice, so Highcharts took the second value, which was areaspline. Good advice - you don't have to update whole chart, just properties which you are going to change, like type. Look at line 994 https://jsfiddle.net/Bastss/hx4nembL/. Another think - if you are using one data fourth times you can define your data to some array and later use only this array. Your code will be much nicer :)

Best regards!
Sebastian Wędzel,
Highcharts Developer

Return to “Highcharts Usage”