问题
I am using flot to create bar charts like
I need to specify a threshold like a line at 750(y axis) for example, to show the limit... there is one jquery.flot.threshold.js file in flot package, but i dont know how to use it on bar charts.How to do it ?
回答1:
Seems there was some issues with using the threshold plugin with the current flot release version. If you just want to mark a threshold, it might be easier to use the grid markings option:
$.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" }]
}
});
Produces (fiddle here):
来源:https://stackoverflow.com/questions/9092263/how-to-create-a-line-to-show-threshold-in-bar-graph