Bar with Target Line Flot
HTML
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.0.0/jquery.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.js"></script>
<div id="graph"></div>
CSS
#graph {
margin: 0 auto;
text-align: center;
width: 100%;
height: 250px;
}
JavaScript
$(function() {
var data = [
[
[0, 5],
[3, 5],
[5.0, 10],
[6.0, 10],
[7.0, 0]
]
];
var options = {
series: {
lines: {
show: true,
lineWidth: 3
},
points: {
show: true
}
},
xaxis: {
min: 0,
tickDecimals: 0,
max:data[0][4][0],
ticks: [data[0][0][0], data[0][1][0], data[0][2][0], data[0][3][0], data[0][4][0]]
}
};
console.log(data[0][1])
var plot = $.plot($('#graph'), data, options);
});