1 Reply Latest reply on Jan 13, 2009 7:36 AM by matthew horn

    multiple axes chart - baseline issue

    mcruse
      Hi all,

      I'm currently working on charts (column, bar, line, ..) with multiple axes (each for one series).

      If negative amount values are shown in a chart, the baselines (for zero values) appears
      on different coordinates/levels.

      As an example see the code listed below:

      <?xml version="1.0"?>
      <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", Profit:2000, Expenses:15},
      {Month:"Feb", Profit:1000, Expenses:20},
      {Month:"Mar", Profit:1500, Expenses:50},
      {Month:"Apr", Profit:100, Expenses:-10}
      ]);
      ]]>
      </mx:Script>
      <mx:Panel title="Column Chart">
      <mx:ColumnChart id="myChart" dataProvider="{expenses}" showDataTips="true">
      <mx:horizontalAxis>
      <mx:CategoryAxis dataProvider="{expenses}" categoryField="Month"/>
      </mx:horizontalAxis>
      <mx:series>
      <mx:ColumnSeries xField="Month" yField="Profit" displayName="Profit">
      <mx:verticalAxis>
      <mx:LinearAxis id="v1"/>
      </mx:verticalAxis>
      </mx:ColumnSeries>
      <mx:ColumnSeries xField="Month" yField="Expenses"
      displayName="Expenses">
      <mx:verticalAxis>
      <mx:LinearAxis id="v2"/>
      </mx:verticalAxis>
      </mx:ColumnSeries>
      </mx:series>
      <mx:verticalAxisRenderers>
      <mx:AxisRenderer placement="left" axis="{v1}"/>
      <mx:AxisRenderer placement="right" axis="{v2}"/>
      </mx:verticalAxisRenderers>
      </mx:ColumnChart>
      <mx:Legend dataProvider="{myChart}"/>
      </mx:Panel>
      </mx:Application>

      I'm using Flex Builder 3.0.2 /Flex SDK 3.2.

      Is this is a bug in flex?
      Am i missing something in the mxml/as, or is there a solution or workaround?

      Any hints are highly appreciated.

      Regards,
      Matthias