Flot Graph没有填充

时间:2013-03-06 10:49:37

标签: javascript jquery flot

我找到了mt问题的相关答案,但在我的案例中没有用。我是剧情绘图。              var qwer = []; data = [[qwer]]; $ .plot(“#placeholder”,data,options);

qwer有这个价值             [1361451916000,36.862274],[1361451915000,1000.664185],[1361451915000,33.470932],[1361451915000,0.331087],[1361451915000,3.854041],[1361451915000,2.084494],[1361451915000,622.265259],[1361451915000,167.02771],[1361451853000 ,1000.628418],[1361451853000,33.482491],[1361451853000,0.34266],[1361451853000,3.781773],[1361451853000,2.14386],[1361451853000,625.780762],[1361451853000,166.767822],[1361451853000,36.863419],[1361451793000,1000.501465 ],[1361451793000,33.446846],[1361451793000,0.339476],[1361451793000,3.729937],[1361451793000,2.390623],[1361451793000,622.265259],[1361451793000,167.497406],[1361451793000,36.860085],[1361451733000,33.503113] [1361451733000,0.352068],[1361451733000,3.797665],[1361451733000,2.168059],[1361451733000,631.054565],[1361451733000,167.291168],[1361451733000,36.847496],[1361451732000,1000.508667],[1361451673000,634.570068],[1361451673000 ,167.753693],[1361451673000,36.867523],[1361451672000,1000.680298],[1361451672000,33.4543],[1361451672000,0.34401],[1361451672 000,3.687938],[1361451672000,2.069354],[1361451617000,634.570068],[1361451617000,166.691528],[1361451617000,36.854553],[1361451616000,1000.682129],[1361451616000,33.429085],[1361451616000,0.352169],[1361451616000, 3.652372],[1361451616000,2.104402],[1361451616000,2749.431641],[1361451616000,26.239849]

但它没有绘制我的图表。 如果是使用数据= [[[1361451915000,100],[1361451853000,200],[1361451793000,500],[1361451733000,300]]];

它对我来说很好。可能的原因是什么。

提前致谢。

1 个答案:

答案 0 :(得分:1)

我建议用另外一组括号包装你的var qwer:

qwer =  [[1361451916000,36.862274],[1361451915000,1000.664185],[1361451915000,33.470932]]

然后将该数据集推送到var数据

data.push(qwer)

看看这个 - http://jsfiddle.net/KMTjZ/1/