开发者

Flex Chart Exceeds Axis Maximum

开发者 https://www.devze.com 2023-02-16 07:31 出处:网络
I need to figure out how to get a column in a 开发者_开发百科columnchart to show 100% height if it exceeds the axis maximum. For example, I am using a linear axis with a maximum of 2 but want to visua

I need to figure out how to get a column in a 开发者_开发百科columnchart to show 100% height if it exceeds the axis maximum. For example, I am using a linear axis with a maximum of 2 but want to visually show that the column is at least 2 or greater but not show more than 2 on the axis. Currently if a value exceeds the axis maximum, flex simply doesn't show the column.


I think the best approach here would be to create a second collection based on the original one and use this as the dataProvider for the chart.

Write a function that checks the axis maximum and reset any variables in the second collection that are above this to the maximum. Also, add an extra variable that stores the difference between the max and the original value, and have this displayed in the dataTip.

Add a change listener (CollectionEvent.COLLECTION_CHANGE) to the original array, and use the handler to update the second array.


I decided to use perl to parse the xml ahead of time and add additional fields with adjusted values that fit within the maximum and minimum range. Then I use those fields in the chart and a custom datatip referencing the actual value.

0

精彩评论

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