Graph data provider has values but graph is not plotting

134 Views Asked by At

In the below code the traced values are correct its there in the chart data provder but the

input graph is not plotting.there is no error in this code.Can anyone solve it?

function fnctn(evt:Event)

{


         var tp:int = bulb1 + bulb2 + bulb3 + bulb4;

   if(tp == 1)

   {


           var ChartcategoryNames:Array=new Array();

           var ChartDataProvider1:Array=new Array();

           var lineArray1:LineSeries=new LineSeries();

           ChartDataProvider1=new Array();

           ChartDataProvider1.slice(0,ChartDataProvider1.length-1);

            ChartcategoryNames.slice(0,ChartcategoryNames.length-1);

        for (var j=0; j<xml.graph.Current.length(); j++)

                    {
                         trace("j="+j);


                            for (var l=0;l<xml.graph[j].Voltage.length();l++) 

                            {

                            for (var k=0; k<xml.graph[j].Current.length();k++)

                                    {
                                  trace("current= "+xml.graph[j].Current[k].text());

Exp_Content.input_mc.in_graph.categoryNames=ChartcategoryNames;

ChartcategoryNames.push(xml.graph[j].Voltage[l].text());

trace("voltage= "+xml.graph[j].Voltage[l].text());

                                            yAxis = new NumericAxis();

                                            xAxis = new NumericAxis();

                                            yAxis.maximum=20;

                                            yAxis.minimum=0;

                                            xAxis.minimum=0;

                                            xAxis.maximum=0.5;

                                            yAxis.majorUnit=2;

                                            xAxis.majorUnit=0.01;

                                            Exp_Content.input_mc.in_graph.verticalAxis=yAxis;

                                            Exp_Content.input_mc.in_graph.horizontalAxis=xAxis;


                                    }
                            }
                }
                             lineArray1.dataProvider=ChartDataProvider1;

                             Exp_Content.input_mc.in_graph.dataProvider=lineArray1;

                                              Exp_Content.input_mc.in_graph.categoryNames=ChartcategoryNames;

                              trace("ChartDataprovidery= "+ChartDataProvider1);

                              trace("ChartDataproviderx= "+ChartcategoryNames);

}

}

the traced values are shown below

j=0

current= 0.000000

voltage= 0.000000

j=1

current= 0.004478

voltage= 16.166764

j=2

current= 0.004370

voltage= 15.452349

.......

j=87

current= 0.002512

voltage= 15.983058

ChartDataprovidery= 0.000000,0.004478,0.004370,0.001734,0.002598,0.002598,0.001691,0.001626,0.002555,0.002555,0.002577,0.001648,0.001734,0.002598,0.002577,0.002447,0.002534,0.002512,0.001562,0.001648,0.002577,0.002555,0.002555,0.002555,0.001734,0.002469,0.002512,0.002555,0.001648,0.001756,0.002577,0.002577,0.002598,0.002577,0.002555,0.001670,0.002490,0.002512,0.002577,0.002577,0.001713,0.001626,0.002577,0.002490,0.001605,0.002469,0.002512,0.001497,0.002490,0.002490,0.002534,0.001562,0.002598,0.001540,0.001475,0.002490,0.002469,0.002534,0.002512,0.001497,0.002490,0.002577,0.001475,0.001518,0.001540,0.001540,0.001562,0.001475,0.001518,0.001562,0.001562,0.001540,0.001497,0.001454,0.001518,0.001691,0.002555,0.002577,0.001756,0.002598,0.002598,0.002598,0.002534,0.002555,0.002555,0.002512,0.002512,0.002512

ChartDataproviderx= 0.000000,16.166764,15.452349,10.549629,16.235776,16.207588,10.499086,10.5437

1

There are 1 best solutions below

0
On

Check the graph with the sample provider through the declaration tag

If it is a web APP Clear the Cache of the browser and also cookies.

Then See Whether it is running or not