开发者

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="{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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜