Поставщик данных графика имеет значения, но график не строит - PullRequest
1 голос
/ 22 августа 2011

В приведенном ниже коде прослеживаемые значения верны, поскольку они есть в поставщике данных диаграммы, но входной график

не отображается. В этом коде нет ошибки. Может кто-нибудь решить ее?

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);

}

}

отслеживаемые значения показаны ниже

j = 0

ток = 0,000000

напряжение = 0,000000

j = 1

ток = 0,004478

напряжение = 16,166764

j = 2

ток = 0,004370

напряжение = 15,452349

.......

j = 87

ток = 0,002512

напряжение = 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,208888,10,499086,10,5437

1 Ответ

0 голосов
/ 22 августа 2011

Проверьте график с поставщиком образцов через тег объявления

Если это веб-приложение Очистите кэш браузера, а также куки.

Тогда посмотрите, работает он или нет

...