I'm trying to use checkboxes in the legend to show/hide series. Users have complained about not understanding how they can show/hide series because they either didn't understand a visible series can be clicked to hide and grey out; or for the greyed-out series they didn't understand they can click them in the legend to show them and instead thought that greyed-out may mean "no data available" or similar.
Also, if I'm trying to use the checkboxes for show/hide, I'd have to tick them when a series is added. Calling select(true) on the series doesn't set the checkbox. Probably some issue with trying this on a not-yet-drawn chart. Any ideas how I can initially select the checkbox?
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Regarding your first question: given that that appears to be an issue with the core Highcharts JS library, you'll probably have better luck posting that question over on the main Highcharts forums. If anyone on this forum knows how to improve the layout of the select checkboxes though, please speak up! :)
Regarding your second question: given the way the core Highchart's JS library works in order to set the default selection state of the series, you'll need to use the SeriesPlotOptions.setSelected(true) method. (Probably would be nice for the GWT Highcharts "Series.select()" method to handle managing that plot option for you in the case that the method is called before the series is rendered, so I'll add that to the enhancement list.)
Hope that helps,
-Shawn
BTW - if you do get an answer to your first question over on the Highcharts forums, it'd be great if you could post the solution here as well for other GWT Highcharts users to benefit from.
Last edit: Shawn Quinn 2012-03-22
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm trying to use checkboxes in the legend to show/hide series. Users have complained about not understanding how they can show/hide series because they either didn't understand a visible series can be clicked to hide and grey out; or for the greyed-out series they didn't understand they can click them in the legend to show them and instead thought that greyed-out may mean "no data available" or similar.
Adding the checkboxes to the legend seems to break the layout. See http://jsfiddle.net/gh/get/jquery/1.7.1/highslide-software/highcharts.com/tree/master/samples/highcharts/plotoptions/series-showcheckbox-true/. There, the series labels in the legend should be "Series 1" and "Series 2", respectively, but the "1" and "2" are hidden behind the checkboxes.
Also, if I'm trying to use the checkboxes for show/hide, I'd have to tick them when a series is added. Calling select(true) on the series doesn't set the checkbox. Probably some issue with trying this on a not-yet-drawn chart. Any ideas how I can initially select the checkbox?
Hi Axel,
Regarding your first question: given that that appears to be an issue with the core Highcharts JS library, you'll probably have better luck posting that question over on the main Highcharts forums. If anyone on this forum knows how to improve the layout of the select checkboxes though, please speak up! :)
Regarding your second question: given the way the core Highchart's JS library works in order to set the default selection state of the series, you'll need to use the SeriesPlotOptions.setSelected(true) method. (Probably would be nice for the GWT Highcharts "Series.select()" method to handle managing that plot option for you in the case that the method is called before the series is rendered, so I'll add that to the enhancement list.)
Hope that helps,
BTW - if you do get an answer to your first question over on the Highcharts forums, it'd be great if you could post the solution here as well for other GWT Highcharts users to benefit from.
Last edit: Shawn Quinn 2012-03-22
And the following method proved helpful in setting up a chart such that it works well with the above: