开发者

Hide ColumnSeries in Flex Chart

开发者 https://www.devze.com 2022-12-18 11:05 出处:网络
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

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="{checkbo开发者_StackOverflowx.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!


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;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消