Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Hide ColumnSeries in Flex Chart

I have a clustered chart with 2 column series. The problem is that sometimes one column's values are so large, the other column is dwarfed. So I added checkboxes to show/hide a given column, and set the visibility of the ColumnSeries as such:

visible="{checkbox.selected}" includeInLayout="{checkbox.selected}"

This shows/hides the given column correctly, the problem is that it does not reset the Y-Axis, so the other column never actually grows in height (when the column with the larger values is hidden). I've tried resetting the data provider, validating/invalidating the chart, and nothing seems to work.

Anyone have any ideas?

Thanks!

like image 610
gmoniey Avatar asked Mar 08 '26 02:03

gmoniey


1 Answers

I would imagine from your description that you actually need to remove the series from the chart. So

public function onToggle(){
    var newSeries:Array = [];
    if(bigSeries.selected) {
       newSeries.push(bigSeries);
    }
    if(smallSeries.selected) {
       newSeries.push(smallSeries);
    }
    chart.series = newSeries;
}
like image 98
slashnick Avatar answered Mar 10 '26 16:03

slashnick



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!