actionscript 3 - Automatically update annotations in mx:ColumnChart -
so, have chart (simplified):
<fx:declarations> <mx:solidcolor id="solidcolor" color="0x90ee90"/> <mx:solidcolorstroke id="solidcolorstroke" color="0x90ee90"/> </fx:declarations> <mx:columnchart id="columnchart" width="100%" height="100%"> <mx:annotationelements> <mx:cartesiandatacanvas id="cartesiandatacanvas" includeinranges="true"/> </mx:annotationelements> <mx:horizontalaxis> <mx:datetimeaxis id="datetimeaxis"/> </mx:horizontalaxis> <mx:horizontalaxisrenderers> <mx:axisrenderer axis="{datetimeaxis}"/> </mx:horizontalaxisrenderers> <mx:verticalaxis> <mx:linearaxis id="linearaxis" baseatzero="false"/> </mx:verticalaxis> <mx:verticalaxisrenderers> <mx:axisrenderer axis="{linearaxis}"/> </mx:verticalaxisrenderers> <mx:series> <mx:columnseries xfield="time" yfield="value" fill="{solidcolor}" stroke="{solidcolorstroke}"/> </mx:series> </mx:columnchart>
from time time in chart updated columnchart.dataprovider
. need draw on chart 2 horizontal lines (for min , max values) , yet something. know of can drawn in annotationelements
oncartesiandatacanvas
.
the question is: @ point (or event) should redraw annotations match actual data?
i tried after updating columnchart.dataprovider
. it's - in datetimeaxis
andlinearaxis
did not have time calculate new min , max values. foolish calculate them manually.
i believe can try change
event on columnchart
as:
<mx:columnchart id="columnchart" width="100%" height="100%" change="handlechange(event)"> </mx:columnchart>
then in method handlechange
you can work.
Comments
Post a Comment