Ok, the Adobe Flex forums are full of crickets, so I'll see who's on
this list. :)
I have a line chart with a horizontal slider control which adjusts the
scale of the y axis accordingly so users can better make out the mess of
small line series piled at the bottom.
The slider works great. What I am having problems with is getting the
maximum value of the slider to match the maximum value of the axis. The
datProvider of the chart (and therefore, the auto-calculated maximum of
the axes) are populated after the chart loads via a remote object call
so the maximums are not known when the graph first loads.
My first approach was to bind to the maximum value of the axis, but that
property is not bindable and I'm not sure if I can make it so. Perhaps
if I subclassed the LinearAxis class and overrode that property-- but I
couldn't' really find anything on the internet to help me there, so I
tried approach two.
I looked through the LineSeries class in the Flex 3 SDK and noticed that
the maximum setter dispatches the "axisChange" event any time the
maximum is updated.
dispatchEvent(new Event("axisChange"));
So I attached a listener to my y axis to listen for that event and
handle it so I could go snag the new maximum value and use it to update
my slider.
<mx:LinearAxis id="my_chart_y_axis" title="Number of Memberships" />
my_chart_y_axis.addEventListener('axisChange',update_slider);
The good news is the listener appears to work perfectly.
private function update_slider(event:Event):void
{
mx.controls.Alert.show(mx.utils.ObjectUtil.toString(LinearAxis(my_chart.verticalAxis).maximum));
}
I get 6 alerts (one for each series). The problem is, the axis maximum
value alerts at 100 every single time. (The default max)
Am I missing something really obvious? Should I be accessing the max
value differently?
Thanks.
~Brad
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to
date
Get the Free Trial
http://ad.doubleclick.net/clk;207172674;29440083;f
Archive: http://www.houseoffusion.com/groups/flex/message.cfm/messageid:5511
Subscription: http://www.houseoffusion.com/groups/flex/subscribe.cfm
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.37