I have been using Flot charts for a short time and I need to make a chart that looks something like this:
I've managed to make the bar chart to color each bar in red if it's above the target and green if it's below but I can't display the target line above. The target represents the black line that is above each bar (each hole has one target).
function BarChart(id, data, ticksl) {
$.plot(id, data, {
series: {
// stack: true
},
grid: {
hoverable: true,
clickable: true
//,horizontal: true
},
bars: {
show: true,
barWidth: 0.5,
align: "center"
}
, xaxis: { ticks: ticksl },
legend: {
show: true
}
});
}
and here is how I call this function: BarChart('#ChartD', values, ticksl);
Values is a array that contains the moves that were made for each hole and the color and ticks1 array contains each hole number.
Is there any way that I can add those target lines to my chart using the same BarChart function?
EDIT: Added a sample, but seen that it works only for the Explorer browser https://jsfiddle.net/yyxvnjum/6/