Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Type 'spline' changed to 'line' causes problems going to other types after that. #2322
I am using 3.0.6. The specific issue noted in Issue #2270 has been fixed. However, there are other similar problems.
I have 3 series in a chart of type=spline. I can toggle between line and spline correctly. However, when I go from Line to Area I get an AreaSpline instead. And when I click Line I get a Spline instead. Clicking Line after that does nothing. But if I click Spline and THEN click Line the chart is re-drawn correctly.
Similarly, if I click Column it renders correctly. But when I click Line after that it renders a Spline instead.
Same thing for Scatter and Pie charts.
Bottom line - if the chart is first set up as a Spline then you click a button to change it to Line, the renderings of other buttons do not work correctly going forward or coming back to Line.
On the positive side: if the chart starts life as a Line chart then all transitions to other types seem to work correctly.
The problem is that the
Demonstrated here: http://jsfiddle.net/highcharts/W2etK/
A permanent fix would not only resolve this case, but also similar potential cases where a method survives switching where it shouldn't.
It's because when a Series is created it's given a specific prototype given its type (for example, OHLCSeries). When the type changes, this prototype isn't changed. This is the core issue.
You can also reproduce this by creating a Candlestick series and switching it to type Line.