0 Replies Latest reply on Oct 25, 2006 10:21 AM by rw_dai

    LineChart -> LinearAxis -> baseAtZero results in Buffer Overflow

    rw_dai
      Hi,

      I found some strange behavior when using LineCharts and would like to know how to avoid it.

      It always occurs when the y-values of the chart are all equal and big (>6 digits) and the LinearAxis->baseAtZero field is set to false. For the 2nd example posted below this often results in a Browser Buffer Overflow or at least it slows down the application significantly using much more RAM than the 1st example.
      However, I never had problems when the baseAtZero field was set to true and/or the y-values of the charts weren't equal (example 1.).
      To me this seems to be a bug in the LinearAxis-Component.

      Any help/workaround is highly appreciated!!

      Robert

      ------
      My Test Setup: XP+Flex 2.0+Firefox (1.5 and 2.0)/IE 6

      Example 1 (Working):

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
      <![CDATA[
      [Bindable]
      public var newData:Array = [
      {X:1,Y:2684355},
      {X:2,Y:2684356}
      ];
      ]]>
      </mx:Script>

      <mx:LineChart x="10" y="10" id="linechart1" dataProvider="{newData}">
      <mx:verticalAxis>
      <mx:LinearAxis autoAdjust="true" baseAtZero="false"/>
      </mx:verticalAxis>

      <mx:series>
      <mx:Array>
      <mx:LineSeries yField="Y" xField="X" />
      </mx:Array>
      </mx:series>
      </mx:LineChart>

      </mx:Application>

      Example 2 (NOT or VERY SLOW working, the only difference to 1. are the equal Y-values):

      <?xml version="1.0" encoding="utf-8"?>
      <mx:Application xmlns:mx=" http://www.adobe.com/2006/mxml" layout="absolute">
      <mx:Script>
      <![CDATA[
      [Bindable]
      public var newData:Array = [
      {X:1,Y:2684355},
      {X:2,Y:2684355}
      ];
      ]]>
      </mx:Script>

      <mx:LineChart x="10" y="10" id="linechart1" dataProvider="{newData}">
      <mx:verticalAxis>
      <mx:LinearAxis autoAdjust="true" baseAtZero="false"/>
      </mx:verticalAxis>

      <mx:series>
      <mx:Array>
      <mx:LineSeries yField="Y" xField="X" />
      </mx:Array>
      </mx:series>
      </mx:LineChart>

      </mx:Application>