javascript - Jquery 浮点图不绘制

标签 javascript jquery charts flot

我有以下 JS 数据:

var store = [];
store.push([new Date('2012-01-01'), 2]);
store.push([new Date('2012-01-02'), 3]);
store.push([new Date('2012-01-03'), 4]);
store.push([new Date('2012-01-04'), 6]);
store.push([new Date('2012-01-05'), 3]);
store.push([new Date('2012-01-06'), 4]);
store.push([new Date('2012-01-07'), 2]);
store.push([new Date('2012-01-08'), 1]);
store.push([new Date('2012-01-09'), 4]);
store.push([new Date('2012-01-10'), 2]);
store.push([new Date('2012-01-11'), 3]);
store.push([new Date('2012-01-12'), 6]);
store.push([new Date('2012-01-13'), 2]);
store.push([new Date('2012-01-14'), 5]);
store.push([new Date('2012-01-15'), 4]);
store.push([new Date('2012-01-16'), 2]);
store.push([new Date('2012-01-17'), 6]);
store.push([new Date('2012-01-18'), 6]);
store.push([new Date('2012-01-19'), 1]);
store.push([new Date('2012-01-20'), 1]);
store.push([new Date('2012-01-21'), 1]);
store.push([new Date('2012-01-22'), 8]);
store.push([new Date('2012-01-23'), 8]);
store.push([new Date('2012-01-24'), 13]);
store.push([new Date('2012-01-25'), 5]);
store.push([new Date('2012-01-26'), 5]);
store.push([new Date('2012-01-27'), 1]);
store.push([new Date('2012-01-28'), 1]);
store.push([new Date('2012-01-29'), 2]);
store.push([new Date('2012-01-30'), 6]);

float 代码:

$.plot($('.chart'), store);

HTML:

<div class="chart"></div>

我在 x 和 y 上的轴只显示从 -1 到 1.. 我根本看不到绘图。我哪里错了?

enter image description here

提前致谢

最佳答案

我遇到了这个问题,我认为你需要将你的数组包装在另一个数组中......

$.plot($('.chart'), [store]);

关于javascript - Jquery 浮点图不绘制,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10904419/

相关文章:

javascript - jQuery在Keypress事件上

javascript - 在条形之间添加空格/边距 - Chart.js

javascript - AmCharts 股票图表 : remove Compare to selection box

javascript - Console.log 和函数返回 (Javascript)

javascript - 如何在asp.net中的客户端点击事件上调用2个javascript

javascript - JS 下拉菜单

javascript - 谷歌图表时间轴水平滚动

javascript - 真正用 typeof 检查是否未定义

javascript - 将数组推送到多维数组

jQuery Resizing() UI 问题