图形数据提供程序有值,但图形未绘制
在下面的代码中,图表数据提供程序中的跟踪值是正确的,但
输入图形未绘制。此代码中没有错误。任何人都可以解决它吗?
函数 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());
跟踪(“电压=”+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
图表数据提供= 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
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
通过声明标签与示例提供者检查图表
如果是Web APP,请清除浏览器的缓存和cookie。
然后查看是否正在运行
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