1 Reply Latest reply on Jan 21, 2010 12:26 AM by RUSH-ME

    columnSet with vertical axis for each series in the set

    gilb1978

      Hi,

       

      when I have a column set that includes 3 series, and each series has its own vertical axis (LinearAxis), the chart I get seems to have only one vertical axis (and not one for each series).

       

      this causes the chart to sometimes show only some of the series (when the values are out of axis range).

       

      I am adding a snippet to try and explain the problem:

       

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute" minWidth="1024" minHeight="768" creationComplete="OnCreationComplete(event)">
          <!-- charts/StackedNegative.mxml -->
              <mx:Script><![CDATA[
                  import mx.charts.LinearAxis;
                  import mx.charts.series.ColumnSeries;
                  import mx.collections.ArrayCollection;
                  [Bindable]
                  public var expenses:ArrayCollection = new ArrayCollection([
                      {Month:"Jan", Profit:12, Expenses:20, costs:1230},
                      {Month:"Feb", Profit:11, Expenses:19, costs:2000},
                      {Month:"Mar", Profit:5, Expenses:11, costs:1902},
                      {Month:"Apr", Profit:2, Expenses:15, costs:2540}
                  ]);
                 
                  private function OnCreationComplete(event:Event):void
                  {
                      myChart.verticalAxisRenderer.visible = false;
                  }
              ]]></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:ColumnSet type="clustered" id="cSet">
                              <mx:series>
                                  <mx:ColumnSeries
                                      xField="Month"
                                      yField="Profit"
                                      displayName="Profit"
                                      verticalAxis="{new LinearAxis()}"
                                      />
                                  <mx:ColumnSeries
                                      xField="Month"
                                      yField="Expenses"
                                      displayName="Expenses"
                                      verticalAxis="{new LinearAxis()}"
                                      />
                                  <mx:ColumnSeries
                                      xField="Month"
                                      yField="costs"
                                      displayName="costs"
                                      verticalAxis="{new LinearAxis()}"
                                      />
                              </mx:series>
                          </mx:ColumnSet>          
                      </mx:series>
                  </mx:ColumnChart>
                  <mx:Legend dataProvider="{myChart}"/>
              </mx:Panel>
      </mx:Application>

       

      the result of this code is:

       

      c1.JPG

      if I just change the order of the series:

      <mx:series>
                                <mx:ColumnSeries
                                      xField="Month"
                                      yField="costs"
                                      displayName="costs"
                                      verticalAxis="{new LinearAxis()}"
                                      />
                                  <mx:ColumnSeries
                                      xField="Month"
                                      yField="Profit"
                                      displayName="Profit"
                                      verticalAxis="{new LinearAxis()}"
                                      />
                                  <mx:ColumnSeries
                                      xField="Month"
                                      yField="Expenses"
                                      displayName="Expenses"
                                      verticalAxis="{new LinearAxis()}"
                                      />

      </mx:series> 

       

      the chart would look like this (a series is missing)

      c2.JPG

      Last thing is that if I remove the ColumnSet from this example, and just add the series to the chart, everything works fine.

       

      Am I doing something wrong or is this a bug of the columnSet??

       

      thanks,

       

      Gil