0 Replies Latest reply on Nov 2, 2010 7:13 AM by Sen Imagines

    Problem with Multiple PlotSeries with "0" as its value

    Sen Imagines Level 1



      I am using a Flex 3 Plot chart. Data for which is sent thru a remote XML file.


      PerComp in x-axis & CostHigh / CostLow in the y-axis


      I use two plot series: LowSeries which takes "CostLow" parameter value fom the XML for its y axis value and

      "CostHigh" series  which takes "CostHigh" parameter value fom the XML for its y axis value


      and the XML node can have either CostHigh (or) CostLow.

      If CostHigh is there, it shuld be added to the HighSeries in the chart

      If CostLow is there, it shuld be added to the LowSeries in the chart


      When I give a value of "0", to any of the CostHigh / CostLow XML node, i am getting duplicate plottings / incorrect plottings.


      The Sample XML data:



      <?xml version="1.0" encoding="utf-8"?>


          <product PerComp="10">





          <product PerComp="30">





          <product PerComp="50">







      The Sample Code:


      <?xml version="1.0"?>


      <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:local="*" layout="absolute" initialize="init()" creationComplete="srv.send()">


      <mx:HTTPService id="srv" url="myChartData.xml" />





             import mx.charts.renderers.*;

              import flash.events.Event;       

              import mx.rpc.events.FaultEvent;

              import mx.charts.events.ChartItemEvent;

              import mx.charts.HitData;


              /* FAULT HANDLER */

              public function myFaultHandler(event:FaultEvent):void






              public function myDataTipFunction(hd:HitData):String


                   return "<B>"+hd.item.ProdName+"</B>";






          <!-- Define custom colors for use as plot point fills. -->

          <mx:SolidColor id="lowfill" color="#67ab1f" alpha=".6"/>

          <mx:SolidColor id="highfill" color="#F30707" alpha=".6"/>



            <mx:VBox width="100%" height="100%" horizontalAlign="center" backgroundColor="#FFFFFF" paddingTop="8">

          <mx:HBox width="98%" horizontalAlign="left" verticalAlign="middle">

              <mx:Legend dataProvider="{myInteractiveChart}" direction="horizontal"/>



              <mx:PlotChart id="myInteractiveChart"





                  dataTipFunction="myDataTipFunction" selectionMode="single"




                 <mx:LinearAxis title="Cost" />




                 <mx:LinearAxis title="% Complete"/>




                      <mx:PlotSeries id="LowSeries" xField="PerComp" yField="CostLow" displayName="Low Series" radius="8"                   





                      id="HighSeries" xField="PerComp" yField="CostHigh" displayName="Red Series" radius="8"











      How can I rectify this?


      - Sen