View Full Version : [B3] Charts: programmatically show / hide series

20 Apr 2011, 3:32 AM
I have been running into the following issues when trying to programmatically hide / show specific series in a chart (probably most points are valid for highlighting as well).

Area series: I don't think there's any "supported" way to hide or show a specific element in an area series
Legend: when using hideAll() on a line series, the corresponding LegendItem should be reflect the new state (i.e. turn gray)
Markers: when using hideAll() on a line series, and then turning it back on by clicking twice (! twice because of my second point above) on the corresponding LegendItem, the line shows up again but without its markers

I think programmatically showing / hiding / highlighting series will be a common scenario and should be looked into further. For example, data displayed in a chart might also be displayed elsewhere (let's say in a grid), it should be possible to reflect user interactions with this grid in the chart.

20 Apr 2011, 5:50 AM
Tbh, there is a way to achieve this.
But its hard to get to, because to dont have any methods according to do this.

Right now u have to get under the hood of the chart, and manipulating every series/legend item by its index and show hide it.

What i figured out was, when the legend is turned on u can simply retrieve the legenditem by its index and then fire the mousedown event, which simply does the hide/show all.


But besides that, i have to agree, that there should be a method in Ext.chart.Chart to achieve this goal.


20 Apr 2011, 10:09 AM
Another issue with hiding series is the y axis limits.
Would be good to have an option to redraw the chart with new upper / lower limits after hiding a series.
The highcharts charting package does this and it would be very handy for some charts I am building.

-- Chris