Miles
Miles

Reputation: 5726

Flot bar chart highlight color per series

I have a bar chart with a few series. How can I control what color the highlight color will be on a per series basis? (each of my series is a different colour so I need to highlight them each differently).

I've seen how to do this for a single color throughout the entire chart but I'm needing it specific for each series.

Upvotes: 1

Views: 485

Answers (1)

mechenbier
mechenbier

Reputation: 3067

You need to set the highlightColor option for each series in your data array:

var data = [{
    data: [
        [1, 5],
        [2, 3]
    ],
    highlightColor: "#00FF00"
}, {
    data: [
        [1, 2],
        [2, 8]
    ],
    highlightColor: "#FF0000",
}];

JSFiddle Example

Upvotes: 2

Related Questions