0
votes

I am using flot to create bar charts like

Bar Graph

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
Which version of flot are you using? - Eric Wendelin

1 Answers

4
votes

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):

enter image description here