我正在使用 flot 创建条形图,例如
我需要指定一个阈值,例如 750(y 轴)处的线,以显示限制... flot包中有一个jquery.flot.threshold.js文件,但我不知道如何在条形图上使用它。如何做到这一点?
最佳答案
似乎有some issues将阈值插件与当前的 flot 发行版本一起使用。如果您只想标记阈值,使用网格标记选项可能会更容易:
$.plot($("#placeholder"), [ d1, d2, d3 ], {
series: {
stack: true,
bars: { show: true, barWidth: 0.6 }
},
grid: {
markings: [ { xaxis: { from: 0, to: 12 }, yaxis: { from: 0, to: 20 }, color: "#6D7B8D" }]
}
});
产生( fiddle here ):
关于javascript - 如何创建一条线以在条形图中显示阈值,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9092263/