Flot条形图:在时间轴问题上重叠的条形图 [英] Flot bar chart: bars overlapping on time axis issue
问题描述
我正在尝试根据时间轴绘制费用数据,如果数据栏显示相同日期的数据,我会看到数据栏是重叠的。我期待图表显示相互之间的条形,但事实并非如此。请参阅获取垂直堆栈,或者一个外部插件,如 orderBars 。
在每个系列中,为每个系列添加一个选项,指定它应该堆叠/排序。如果您希望它适用于所有内容,请选择酒吧的整体系列选项。
$。plot($(#placeholder) ),newJson,
{bars:{order:1,show:1,barWidth:24 * 60 * 60 * 1000 * 10},
xaxis:{mode:time}
});
以下是一个工作示例: http://jsfiddle.net/ryleyb/A8yNV/7/
I am trying to plot expense data against time axis, and I see the data bars are overlapping if they are showing data for the same date. I was expecting the graph to show the bars asjascent to each other but that is not the case. See a sample of code at this link...
$.plot($("#placeholder"), newJson,
{
bars: {
show: 1,
barWidth: 24 * 60 * 60 * 1000 * 10
},
xaxis: { mode:"time" }
});
Unfortunately, that isn't possible in flot without using some sort of plugin. I suggest you either use the stacking plugin to get a vertical stack, or an external plugin like orderBars.
In each of them, you add an option to each series specifying that it should be stacked/ordered. Or to the overall series options for bars if you want it to apply for everything.
$.plot($("#placeholder"), newJson,
{bars: { order:1, show: 1, barWidth: 24 * 60 * 60 * 1000 * 10 },
xaxis: { mode:"time" }
});
Here's a working example: http://jsfiddle.net/ryleyb/A8yNV/7/
这篇关于Flot条形图:在时间轴问题上重叠的条形图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!