flexcoders  

[flexcoders] Re: LinearAxis - need help with value ordering! (Repost with sample code)

simonjpalmer
Fri, 04 May 2007 11:40:43 -0700

I'd look at using a custom renderer for the y-axis labels.  I'm not
exactly sure how but I am willing to bet that you can do it.  Is there
a label function or something similar on the LinearAxis?  

Have you poked around on Ely's blog (quietlyscheming.com)  

In the extreme case you can always create your own linear axis which
handles the labelling.

Simon

--- In flexcoders@yahoogroups.com, "Peter Demling" <[EMAIL PROTECTED]> wrote:
>
> Hi All,
> 
> Any suggestions on how to get a numerical y-axis to start at the
> maximum value and descend on up?  For example, the sample app below
> starts the y-axis at zero and goes up to 5; I want it to start at 5
> and go up to zero: "VerticalAxis.reverseDefaultSortOrder()" or
> something.  I've tried and failed with manipulating the "baseAtZero",
> "autoAdjust", minimum" and "maximum" properties.
> 
> Any ideas, kludgey or otherwise??
> 
> Many thanks!
> 
> -Peter Demling
> Lexington, MA
> 
> 
> <?xml version="1.0" encoding="utf-8"?>
> <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
> <mx:Script>
> <![CDATA[     
>       import mx.collections.ArrayCollection;
> 
>       [Bindable]
>        private var sampleData:ArrayCollection =
>        new ArrayCollection([
>       {xValue:10, yValue:1 },
>       {xValue:20, yValue:2 },
>       {xValue:30, yValue:3 },
>       {xValue:40, yValue:4 },
>       {xValue:50, yValue:5 }
>       ]);             
> ]]>
> </mx:Script>
> 
> <mx:LineChart  width="100%"  height="100%"
>   dataProvider="{sampleData}">
>         <mx:verticalAxis>
>               <mx:LinearAxis id="yAxis"/>
>       </mx:verticalAxis>
>       <mx:series>
>               <mx:LineSeries id="primaryLine"
>                   xField="xValue"
>                   yField="yValue"/>
>       </mx:series>
> </mx:LineChart>
> 
> </mx:Application>
>