Tom
Tom

Reputation: 1071

Highcharts - Enable border for 1 column/bar only?

I have a bar chart and I would like to color one of the series white and enable a black border for this series only.

I'd rather not enable a border for everything. Is this possible?

I have a fiddle example - I was hoping it could be achieved in a similar way to the 'color' attribute of the series, but I can't see anything in the API;

    series: [{
        name: 'Measure',
        data: [{
            y: 10}, { y:9, color: 'white'}, { y: 8 }, { y: 7 }, { y: 7.2 }]

    }]

http://jsfiddle.net/ZzXY2/

Upvotes: 0

Views: 1434

Answers (1)

Tom
Tom

Reputation: 1071

It turns out that 'borderColor' is an acceptable attribute of each of the data points, it's just not documented.

Turn the border on and set the default color to white:

plotOptions: {
        bar: {
            borderColor: '#FFFFFF',
            borderWidth: 1
             }
            }

Set the border color within the appropriate series

         series: [{
        name: 'Measure',
        data: [
            {y: score2, color: colors[1], borderColor:'Yellow'}, 
            {y: scoreprev, color: colors[4] },
            {y: score1, color: colors[0] },
            {y: score3, color: colors[2] },
            {y: score4, color: colors[3] }] }]   

Upvotes: 3

Related Questions