0 Replies Latest reply on Jan 17, 2008 1:05 PM by breez11

    LineSeries not displaing

    breez11 Level 1
      I have a column chart which includes a lineSeries graph. the lineSeries is not loading for some reason.

      I am not receiving any errors and I have used the same code before with array collections and everything display ine.

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application pageTitle="CSV Example" initialize="svcStats.send()" xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
      <![CDATA[
      private var _stats:Array = new Array();

      public function parse( result:Object ):void {
      var properties:Array = new Array();
      var headings:Boolean = false;
      var carriage:Number = null;
      var comma:Number = null;
      var cursor:Number = 0;
      var sub:Number = null;
      var item:Object = null;
      var value:String = null;
      var line:String = null;

      while( result.indexOf( "\n", cursor ) != -1 ) {
      carriage = result.indexOf( "\n", cursor );
      line = result.substring( cursor, carriage );

      cursor = 0;
      sub = 0;

      item = new Object();

      while( line.indexOf( ",", cursor ) != -1 ) {
      comma = line.indexOf( ",", cursor );
      value = line.substring( cursor, comma );

      if( !headings ) {
      properties.push( value );
      } else {
      item[properties[sub]] = value;
      }

      cursor = comma + 1;
      sub++;
      }

      value = line.substring( cursor, line.length - 1 );

      if( !headings ) {
      properties.push( value );
      headings = true;
      } else {
      item[properties[sub]] = value;
      Stats.push( item );
      }

      cursor = carriage + 1;
      }
      }

      [ChangeEvent( "StatsChanged" )]
      public function set Stats( value:Array ):void {
      _stats = value;
      }

      public function get Stats():Array {
      return _stats;
      }
      ]]>
      </mx:Script>
      <mx:SeriesInterpolate id="chartChange" duration="2000" />
      <mx:HTTPService id="svcStats" url="data/offload.csv" resultFormat="text" result="parse( event.result )" />
      <mx:Panel title="DNA Dashboard" fontSize="18" width="100%" height="100%" paddingTop="20" paddingBottom="20" paddingLeft="20" paddingRight="20" backgroundColor="#666666">
      <mx:Panel title="Column And Axis Chart Example" fontSize="12" width="600" height="400" paddingTop="5" paddingBottom="5" paddingLeft="5" paddingRight="5" layout="horizontal" x="20" y="25">
      <mx:ColumnChart dataProvider="{Stats}" width="90%" height="100%" showDataTips="true" id="myChart">
      <mx:horizontalAxis>
      <mx:CategoryAxis categoryField="month" />
      </mx:horizontalAxis>
      <mx:series>
      <mx:ColumnSeries xField="month" yField="peer_bytes" displayName="Peer Bytes" showDataEffect="{chartChange}" />
      <mx:ColumnSeries xField="month" yField="web_bytes" displayName="Server Bytes" showDataEffect="{chartChange}" />
      </mx:series>
      <mx:secondSeries>
      <mx:LineSeries dataProvider="{Stats}" yField="offload" form="curve" displayName="Offload" showDataEffect="{chartChange}" />
      </mx:secondSeries>
      </mx:ColumnChart>
      <mx:Legend dataProvider="{myChart}" />
      </mx:Panel>
      </mx:Panel>
      </mx:Application>





      month,peer_bytes,web_bytes,offload
      "Jan",1032,2433,3320
      "Feb",1724,1223,4520
      "Mar",1332,8291,6520
      "Apr",1236,6543,2520
      "May",3523,2342,4520
      "Jun",4525,6053,6620
      "Jul",7654,1245,8720
      "Aug",1234,6754,5422
      "Sep",1267,1238,2320
      "Oct",2346,1238,5420
      "Nov",1928,1238,7620
      "Dev",3210,1983,1220