1 Reply Latest reply on Dec 17, 2007 7:49 AM by mae@ccg

    Multi line chart

    kilyas2007 Level 1
      I have been pondering on this issue for a little while but couldn't figure this out. I have this mxml file which shows multiple lines in a chart. It has three arrays
      1) SMITH
      2) DECKER
      3) JOHN

      Now the question is that if I make SMITH null as in the code pasted, DECKER and JOHN also disappear, but this does not happen if SMITH is not null but DECKER is null. I want that if SMITH is null the rest two lines should still appear. Please advise.

      quote:

      <?xml version="1.0"?>
      <!-- charts/MultipleSeries.mxml -->
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" width="100%"
      height="100%">
      <mx:Script>
      <![CDATA[
      [Bindable]
      public var SMITH:Array = null;/* [
      {date:"22-Aug-05", close:45.87},
      {date:"23-Aug-05", close:45.74},
      {date:"24-Aug-05", close:45.77},
      {date:"25-Aug-05", close:46.06},
      ];*/
      [Bindable]
      public var DECKER:Array = [
      {date:"22-Aug-05", close:45.59},
      {date:"23-Aug-05", close:45.3},
      {date:"24-Aug-05", close:46.71},
      {date:"25-Aug-05", close:46.88},
      ];
      public var JOHN:Array = [
      {date:"22-Aug-05", close:48.87},
      {date:"23-Aug-05", close:44.74},
      {date:"24-Aug-05", close:45.77},
      {date:"25-Aug-05", close:47.06},
      ];
      ]]>
      </mx:Script>

      <mx:Panel title="Multiple Data Series" width="100%" height="100%">
      <mx:LineChart id="mychart"
      dataProvider="{SMITH}"
      showDataTips="true"
      height="100%"
      width="100%"
      >
      <mx:horizontalAxis>
      <mx:CategoryAxis categoryField="date"/>
      </mx:horizontalAxis>
      <mx:verticalAxis>
      <mx:LinearAxis minimum="40" maximum="50"/>
      </mx:verticalAxis>
      <mx:series>
      <mx:LineSeries
      dataProvider="{SMITH}"
      xField="date"
      yField="close"
      displayName="SMITH"
      >
      </mx:LineSeries>
      <mx:LineSeries
      dataProvider="{DECKER}"
      xField="date"
      yField="close"
      displayName="DECKER"
      >
      </mx:LineSeries>
      <mx:LineSeries
      dataProvider="{JOHN}"
      xField="date"
      yField="close"
      displayName="DECKER"
      >
      </mx:LineSeries>
      </mx:series>
      </mx:LineChart>
      </mx:Panel>
      </mx:Application>