0

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/

LAffair
  • 1,968
  • 5
  • 31
  • 60
  • Can you edit this and fill in some data? Then we might be able to help easier. http://jsfiddle.net/yyxvnjum/ – Joe Sep 25 '15 at 13:45
  • You wouldn't guess it from the description, but the above question asks for the same thing (it even links to the same image you show). See my answer there or this [fiddle](https://jsfiddle.net/6cn7tgps/) for details. – Raidri Sep 25 '15 at 14:55
  • BTW: The fiddle-link in the question doesn't work because it is a HTTPS link but the fiddle uses a script loaded over HTTP. Most browsers don't like it when you mix secure and unsecure files. It works when you give a HTTP link: http://jsfiddle.net/yyxvnjum/6/ – Raidri Sep 25 '15 at 15:01
  • @Raidri I've looked at that question and you might be right. It is the same image. I've used it as a pattern but I'll try your answer to that question. Thanks – LAffair Sep 25 '15 at 18:31

0 Answers0