1 Reply Latest reply on Dec 5, 2007 8:54 PM by atta707

    max value of a chart

    mauroyb0
      Actually, my question is completly writtend in the tittle...

      Is it possible to get the max value computed by flex to display a chart ? I mean the computed max value of the axis...
        • 1. Re: max value of a chart
          atta707 Level 2
          category axis of labelFunction property that helps you customize the labels:

          <mx:horizontalAxis>
          <mx:CategoryAxis id="xAxisLabel" categoryField="x" labelFunction="xAxisLabelFunction" />
          </mx:horizontalAxis>

          Here is the signature for label function:

          private function xAxisLabelFunction(labelValue:Object, previousLabelValue:Object, axis:CategoryAxis, labelItem:Object) : String {
          this.maxValue = labelValue
          }

          the first parameter to this function is the label value. So, if you store this value in a class level member, by the time chart is finished rendering you'll have the last value for the label.

          I couldn't think of any simpler way :)

          ATTA