I think you can do this with a column chart's minField property. Is this
what you want?

<?xml version="1.0"?>
<!-- charts/MinFieldColumn.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
  <mx:Script><![CDATA[
     import mx.collections.ArrayCollection;
     [Bindable]
     public var expenses:ArrayCollection = new ArrayCollection([
        {Month: "Jan", Revenue: 1200, Expenses: 500},
        {Month: "Feb", Revenue: 1200, Expenses: 550},
        {Month: "Mar", Revenue: 1240, Expenses: 475},
        {Month: "Apr", Revenue: 1300, Expenses: 600},
        {Month: "May", Revenue: 1420, Expenses: 575},
        {Month: "Jun", Revenue: 1400, Expenses: 600},
        {Month: "Jul", Revenue: 1500, Expenses: 600},
        {Month: "Aug", Revenue: 1600, Expenses: 750},
        {Month: "Sep", Revenue: 1600, Expenses: 735},
        {Month: "Oct", Revenue: 1750, Expenses: 750},
        {Month: "Nov", Revenue: 1800, Expenses: 800},
        {Month: "Dec", Revenue: 2000, Expenses: 850}
     ]);
  ]]></mx:Script>
  <mx:Panel title="Waterfall or Cascading Column Chart">
     <mx:ColumnChart dataProvider="{expenses}" showDataTips="true">
        <mx:horizontalAxis>
           <mx:CategoryAxis dataProvider="{expenses}"
categoryField="Month"/>
        </mx:horizontalAxis>
        <mx:series>
           <mx:ColumnSeries yField="Revenue" minField="Expenses"
displayName="Revenue"/>
        </mx:series>
     </mx:ColumnChart>
  </mx:Panel>
</mx:Application>

You could also set the value of the "invisible" field and use its
series, but make that series invisible by setting the alpha to 0; for
example:

<?xml version="1.0"?>
<!-- charts/WaterfallStacked.mxml -->
<mx:Application xmlns:mx="http://www.adobe.com/2006/mxml";>
  <mx:Script><![CDATA[
     import mx.collections.ArrayCollection;
     [Bindable]
     public var expenses:ArrayCollection = new ArrayCollection([
        {Month: "2005", top: 25, middle: 20, bottom: 17, Invisible:0},
        {Month: "Jan", top: 14, middle: 12, bottom: 10, Invisible:62},
        {Month: "Feb", top: 8, middle: 6, bottom: 4, Invisible:98},
        {Month: "Mar", top: 6, middle: 5, bottom: 5, Invisible:116},
        {Month: "Apr", top: 5, middle: 4, bottom: 4, Invisible:132},
        {Month: "May", top: 5, middle: 3, bottom: 5, Invisible:140},
        {Month: "Jun", top: 4, middle: 3, bottom: 2, Invisible:155},
        {Month: "2006", top: 68, middle: 57, bottom: 39, Invisible:0}
     ]);
  ]]></mx:Script>
  <mx:Panel title="Stacked Waterfall">
     <mx:ColumnChart id="myChart"
        dataProvider="{expenses}" 
        columnWidthRatio=".9" 
        showDataTips="true" 
        type="stacked"
     >
        <mx:horizontalAxis>
           <mx:CategoryAxis 
                dataProvider="{expenses}" 
                categoryField="Month"
            />
        </mx:horizontalAxis>
        <mx:series>
           <mx:ColumnSeries yField="Invisible" displayName="Invisible">
                <mx:fill>
                    <!-- Set alpha to 0 to hide the invisible column.
-->
                    <mx:SolidColor color="0xFFFFFF" alpha="0"/>
                </mx:fill>
           </mx:ColumnSeries>
           <mx:ColumnSeries yField="bottom" displayName="Profit"/>
           <mx:ColumnSeries yField="middle" displayName="Expenses"/>
           <mx:ColumnSeries yField="top" displayName="Profit"/>
        </mx:series>
     </mx:ColumnChart>
  </mx:Panel>
</mx:Application>


hth,
matt horn
flex docs

>  
> 
> > -----Original Message-----
> > From: flexcoders@yahoogroups.com
> > [mailto:[EMAIL PROTECTED] On Behalf Of kb_karthi
> > Sent: Thursday, November 02, 2006 4:24 PM
> > To: flexcoders@yahoogroups.com
> > Subject: [flexcoders] Waterfall chart
> > 
> > Hi,
> > Can anybody post sample code in flex 2.0 for waterfall charts?
> > Any sample on this would be of great help.
> > 
> > Thanks
> > Karthik


--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/flexcoders/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/flexcoders/join
    (Yahoo! ID required)

<*> To change settings via email:
    mailto:[EMAIL PROTECTED] 
    mailto:[EMAIL PROTECTED]

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 

Reply via email to