//我正在尝试使用 fllotchart 在同一个图表中绘制多个图表,我使用类别插件,但它不适用于以下数据
$(function() {
var data = [ ["January", 10], ["February", 8], ["March", 4], ["April", 13], ["May", 17], ["June", 9] ];
$.plot($("#placeholder"), [
{
data: data,
lines: { show: true, fill: true }
},
{
data: data,
bars: { show: true, fill: true }
}
]);
});
最佳答案
您需要将data
放入数组中作为$.plot
的第二个参数,并且您的选项格式不正确。试试这个:
$.plot("#placeholder", [ data ], {
series: {
lines: {
show: true,
fill: true
},
bars: {
show: true,
fill: true
}
},
xaxis: {
mode: "categories"
}
});
这是一个工作示例:
关于javascript - 无法使用 float 绘制图表,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28104731/