0 Replies Latest reply on Aug 18, 2010 11:31 AM by chieffan

    Multiple Line Charts with Column Chart

    chieffan

      I want to show two line charts with a column chart.  Everything goes on the screen fine, except the two line charts origination point always starts at the same point despite the numbers being different.  For example, the ls1 might read 280, 190, 180 and the ls2 is 175, 188, 177 but both origination points start at 280.  The other two datapoints should also be close together but they have a substantial gap of about 50 between them.  Obviosuly I want to have two separate lines.  I have also tried moving the line series below the first lines series with no success.

       

       

       

      <mx:ColumnChart dataTipFunction="formatDataTip"

      id="

      myChart"

      dataProvider="

      {FCVData}"

      showDataTips="

      true"

      selectionMode="

      single"

      change="event.stopImmediatePropagation()"

      width="

      100%" height="95%" y="50">

       

       

      <!-- vertical axis -->

       

       

      <mx:verticalAxis>

       

       

      <mx:LinearAxis title="mytitle" labelFunction="defineVerticalLabel"

      id="

      v1"

      baseAtZero="

      true" />

       

       

      </mx:verticalAxis>

       

       

      <mx:horizontalAxis>

       

       

      <mx:CategoryAxis

      dataProvider="

      {MYData}"

      categoryField="

      YEAR"

       

      />

       

       

      </mx:horizontalAxis>

       

       

      <mx:series>

       

       

      <mx:ColumnSeries

      id="

      pb"

      color="

      #FFFFFF"

      xField="

      YEAR"

      yField="B

      UDGET"

      displayName="

      Budget"

      hideDataEffect="

      zoomOut"

      showDataEffect="

      zoomIn">

       

       

      <mx:fill>

       

       

      <mx:SolidColor color="{colColor1}"/>

       

       

      </mx:fill>

       

       

      </mx:ColumnSeries>

       

       

      <mx:LineSeries id="ls2"

      dataProvider="

      {MYData}"

      yField="

      ACTUAL"

      displayName="

      Actual"

       

      >

       

       

      <mx:itemRenderer>

       

      <mx:Component>

       

      <mx:DiamondItemRenderer/>

       

      </mx:Component>

       

      </mx:itemRenderer>

       

      <mx:lineStroke>

       

       

      <mx:Stroke

      color="

      {lineColor2}"

      weight="

      5"

      alpha="

      .5"

       

      />

       

       

      </mx:lineStroke>

       

      <mx:verticalAxis>

       

       

      <mx:LinearAxis id="v3" baseAtZero="true"/>

       

       

      </mx:verticalAxis>

       

       

      </mx:LineSeries>

       

       

      <mx:ColumnSeries

      id="

       

      asytd"

      color="

      #FFFFFF"

      xField="

      YEAR"

      yField="

      SPEND"

      displayName="

      Spend "

      hideDataEffect="

      zoomOut"

      showDataEffect="

      zoomIn">

       

       

      <mx:fill>

       

       

      <mx:SolidColor color="{colColor2}"/>

       

       

      </mx:fill>

       

       

      </mx:ColumnSeries>

       

       

      <mx:LineSeries id="ls1"

      dataProvider="

      {MYData}"

      yField="

      PLAN"

      displayName="

      Plan"

       

      >

       

       

      <mx:itemRenderer>

       

      <mx:Component>

       

      <mx:CrossItemRenderer/>

       

      </mx:Component>

       

      </mx:itemRenderer>

       

      <mx:lineStroke>

       

       

      <mx:Stroke

      color="

      {lineColor1}"

      weight="

      5"

      alpha="

      .5"

       

      />

       

       

      </mx:lineStroke>

       

      <mx:verticalAxis>

       

       

      <mx:LinearAxis title="title" id="v2" baseAtZero="true"/>

       

       

      </mx:verticalAxis>

       

       

      </mx:LineSeries>

       

       

       

      </mx:series>

       

       

      <mx:verticalAxisRenderers>

       

       

      <mx:AxisRenderer placement="left" axis="{v1}"/>

       

       

      <mx:AxisRenderer placement="right" axis="{v2}"/>

       

       

      <mx:AxisRenderer visible="false" placement="right" axis="{v3}"/>

       

       

      </mx:verticalAxisRenderers>

       

       

      </mx:ColumnChart>