3 Replies Latest reply on Jan 11, 2008 2:53 PM by lollerskatebuttes

    Determining Numeric Axis Max

      Does anyone know the easiest way to determine the max value displayed by a NumericAxis? Do you query the chart? The Axis? The Series? The data provider? I've tried the following, but I always get 0 or NaN:


      I could compute the maximum myself from the data given to the chart, but it seems that there should be an easy way to get it once the chart is created. Thanks for any ideas. --Bruce
        • 1. Re: Determining Numeric Axis Max
          ComputedMaximum is the right thing to use. I am not sure why it is not helping you. Can you post a sample so that we could investigate it.
          • 2. Re: Determining Numeric Axis Max
            sasbrw Level 1
            I don't have a simple example. The problem I'm working on is a multi-chart graph where I'm trying to equalize the response axes of all of the charts. It turned out to be pretty easy to get the maximum response value from each data provider as I was creating each chart, and then just take the max maximum and set it on all of the response axes. This works fine for static charts. If I get to the point of working with dynamic charts, I may have to re-work this solution. Thanks for taking the time to respond. --Bruce
            • 3. Determining Numeric Axis Max
              I was able to do this via script:

              <mx:Label id="myLabel" />
              <mx:LinearAxis id="myAxis" />

              you can then do this:

              private function blah():void{
              myLabel.text = String(myAxis.computedMaximum);

              However, you cannot do this:
              <mx:Label text="{myAxis.computedMaximum}" />


              <mx:Label text="{String(myAxis.computedMaximum)}" />

              So it seems you have to run an update function to set the maximums on each chart manually. Would have been really nice to to do:

              <mx:LinearAxis maximum="{otherAxis.computedMaximum}" />