javascript - Save series chart type for later use -


This high charts may be more than a scope question than the question.

I have a function that changes the chart, please see below:

  function ChangeChartType (chart, Nyaprkar) {newType = newType.toLowerCase (); Var number series = char. Series.length; Var i = 0; If {newType == 'reset'} {for (i; i & lt; numberofseries; i ++) {if (chart type .eries [i] .defaulttype == 'string') {chart.series [i]. Update ({type: chart. Series [i] .defaulttype}); }} For} and {(i; i & lt; numberofseries; i ++) type {if (chart. Range [i] .defaulttype! = 'String') {chart.series [i] .defaulttype = chart .series [i] .type; // does not save new property} chart.series [i] .update ({type: newType}); }}}  

To save the chart type, I am trying to create a new property on the Series object named "defaulttype" which was created chart. When a "reset" button is clicked, I want to change the chart type to store it back in the property.

The problem is that the new property disappears outside of the function. What am I missing? Any help would be appreciated.

I have made a bela to display the whole issue.

You can also set a default type in the chart object, then see the histarchures in your custom function .church [0] objects (keeping in mind their chart), remove the default serie from the user option.

  Uchccrtskcherts [0] .userOptions.chart.defaultType  

Example:


Comments

Popular posts from this blog

sqlite3 - UPDATE a table from the SELECT of another one -

c# - Showing a SelectedItem's Property -

javascript - Render HTML after each iteration in loop -