Tae June Park
Posts: 8
Joined: Wed May 18, 2022 2:38 am

spline redraw animation

Hello I am using spline chart. I am writing because I have a question about the animation function while using it. If you draw a chart through the animation function and duration at first and click the legend, can you redraw it so that the animation and duration functions work and appear again?
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: spline redraw animation

Hi,

There is no specific method for triggering such an animation, but we can achieve the same effect using the Highcharts.addSeries method.

To prevent it from adding the "new" series at the end of our series' array, we have to specify an index. To get the same color and marker as on the initial render, we should also set it in the series options.

DEMO: https://jsfiddle.net/BlackLabel/g08unbj3/
API Reference: https://api.highcharts.com/class-refere ... #addSeries

Best regards!
Kamil Musiałowski
Highcharts Developer
kdp9390
Posts: 62
Joined: Tue Apr 26, 2022 3:20 am

Re: spline redraw animation

I want to draw an animation that flows from the first value to the last value in 'data' instead of from left to right in the chart animation. Is it possible?
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: spline redraw animation

Hello,

To achieve this kind of animation your data has to be sorted (by x values). If you would like to have non sorted data, this animation won't work on spline chart.

Regards!
Kamil Musiałowski
Highcharts Developer

Return to “Highcharts Usage”