我正在尝试根据时间轴绘制费用数据,并且我发现如果数据条显示同一日期的数据,则数据条会重叠。我期望图表显示彼此相邻的条形,但事实并非如此。查看sample of code at this link ...
$.plot($("#placeholder"), newJson,
{
bars: {
show: 1,
barWidth: 24 * 60 * 60 * 1000 * 10
},
xaxis: { mode:"time" }
});
最佳答案
不幸的是,如果不使用某种插件,这在 flot 中是不可能的。我建议您使用stacking plugin获得垂直堆栈,或像 orderBars 这样的外部插件.
在每个系列中,您都可以向每个系列添加一个选项,指定它应该堆叠/排序。或者如果您希望它适用于所有内容,则可以选择条形图的整体系列选项。
$.plot($("#placeholder"), newJson,
{bars: { order:1, show: 1, barWidth: 24 * 60 * 60 * 1000 * 10 },
xaxis: { mode:"time" }
});
这是一个工作示例:http://jsfiddle.net/ryleyb/A8yNV/7/
关于jquery - float 条形图 : bars overlapping on time axis issue,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20264954/