0

I'm trying to add stack labels (http://api.highcharts.com/highcharts#yAxis.stackLabels) to my chart

http://jsfiddle.net/Hjdnw/970/

According to the docs, https://github.com/pablojim/highcharts-ng all options should go into options object.

$scope.chartConfig = {
        options: {
            chart: {
                type: 'bar'
            },
            yAxis: {
              stackLabels: {
                style: {
              color: 'black'
            },
            enabled: true
          }
        },
        },

        series: [{
            data: [10, 15, 12, 8, 7]
        }],
        title: {
            text: 'Hello'
        },

        loading: false
    }

What am I doing wrong?

SteveP
  • 18,840
  • 9
  • 47
  • 60
Joe
  • 4,274
  • 32
  • 95
  • 175

2 Answers2

1

You just need to add the bar stacking method to plotOptions, in chartConfig.options:

plotOptions: {
    bar: {
        stacking: 'normal'
    }
}

When this value is null (or not specified), the stack values are disabled.

Here is a working demo: http://jsfiddle.net/scfy8w53/

j.wittwer
  • 9,497
  • 3
  • 30
  • 32
0

The xAxis should be an object and not an array. The config should be set up like so:

xAxis: {
  categories: ['Option 1', 'Option 2 ']
}

And the update should be:

$scope.chartConfig.xAxis.categories = ['Option New 1', 'Option New 2'];

Fiddle URL

Viral Shah
  • 2,263
  • 5
  • 21
  • 36
  • Are you answering the right question? I want a label on each column that displays the value for the column. A stackLabel. – Joe Dec 17 '14 at 19:13