At first I would like to thank you for this incredible tools, I also want to say congratulations for the support you provide.
I'm currently working on a "chart editor" where the user can change lots of properties at runtime.
I've begin with title properties and create some html control that get initial chart value and update them when they change :
- A textbox for the Text
- A dropdown to set the position (left, center, right)
- A dropdown for the font
- A checkbox to say wheter if the font is bold or not
- A dropdown to select the fontSize
- And a color picker to put font color
This working perfectly using the SetTitle() method here's my code to give you an idea
- Code: Select all
text: ($("#titleTextBox").val()) ? $("#titleTextBox").val() : " ",
fontWeight: ($("#titleBoldCheckbox").attr('checked') == 'checked') ? 'bold' : 'normal',
(Note that the $() stuff is the accessor to my controls values)
I attend to do the same with everything else (Legend, Background,Plot background ..) basically I would like to provide to the user an editor where the user can customize every properties that we can set at initialisation.
I'm now moving to Legend and i begin to have issues
I saw different technique on this forum, one is get the legend element using jquery and set its attribute (like visibility or transform) what I don't like in this is i can't put legend to the left of the chart using this technique like when you set legend align at chart settings (you know when doing a New Chart() on page load)
So I figure out that i can store to chart.options everything I've edit and doing a new chart with theses modified options
For example if I want to modify the legend align property i'm doing that :
- Code: Select all
chart.options.legend.align = "left";
chart = new Highcharts.Chart(chart.options);
this is working of course but it create a new chart and the series are rendering again.
So my questions :
- Is there other to modify all chart properties at runtime without having a rerendering beahvior ? ( I can understand chart need rerendering if we change the data, but here legend are just some text and have nothing to do with data)
- Will you provide method like SetTitle for legend and other properties later ?
- Any chance you already wrote a chart editor ?
Thanks for you feedback