HighCharts remove stack totals

Go To StackoverFlow.com

6

I'm creating a stacked bar chart just like this one. Notice that the total of each stack is displayed at the top, how can I disable/hide this?

2012-04-05 14:56
by Dónal
@Chris "StackLabels" isn't the most Descriptive name for a total sum label. I struggled to find this option (in code written by someone else), too - Stein G. Strindhaug 2014-01-27 10:32


12

yAxis: {
    min: 0,
    title: {
        text: 'Total fruit consumption'
    },
    stackLabels: {
        enabled: false,
        style: {
            fontWeight: 'bold',
            color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
        }
    }
},

you need to turn the stackLabels to false like in the example above

stackLabels: {
            enabled: true,
2012-04-05 15:04
by Luca Filosofi
Thanks for the answer. And what if I wanted to just show the totals and hide the rest? Is this possible - Graph 2016-05-23 13:26
@Graph Do you mean, show only the totals at the top of the stack and hide the labels within the columns? If so, you would want to set plotOptions.series.dataLabels to enabled: false - Mike Zavarello 2016-08-30 12:29
@MikeZavarello that is what I wanted, I can't try it right now but looks promising. Thank you very much - Graph 2016-08-31 12:12
Ads