user2645904
user2645904

Reputation: 169

Highcharts change label text for a single series

In my stacked bar highchart you will see that I have set my last series to the color grey. Is there any way to set the text color to black where the series background color is grey?

plotOptions: {
    series: {
        stacking: 'percent',
    },
    bar: {
        stacking: 'percent',
        dataLabels: {
            enabled: true,
            format: '{y}%',
            style: {
                color: '#ffffff' //This is where i set the color to white
            }
        }
    }
}

http://jsfiddle.net/jimbob25/V446C/

Upvotes: 2

Views: 1813

Answers (1)

Paweł Fus
Paweł Fus

Reputation: 45079

You can set color for each series separately, see: http://jsfiddle.net/V446C/5/

series: [{
    name: 'Poor',
    color: '#E9E9E9',
    data: [12, 23, 13, 18, 7, 19, 9],
    dataLabels: {
        style: {
            color: '#000000'
        }
    }
}, {
    name: 'Satisfactory',
    color: '#629AC0',
    data: [42, 45, 35, 57, 29, 61, 26]
}, {
    name: 'Excellent',
    color: '#006FBC',
    data: [46, 32, 52, 25, 64, 20, 65]
}]

Upvotes: 4

Related Questions