add background color to highcharts stacked Bar Chart

Viewed 27

How i can add background color to highcharts stacked Bar Chart column like in picture

enter image description here

I have try find in highcharts official documentation but unfortunately cant find.

1 Answers

There is no straight way from the API to create such a shadow background for a stacked bar chart, but you can create it as a dummy series with disabled enableMouseTracking and showInLegend options.

Sample code:

  plotOptions: {
    bar: {
      stacking: 'percent'
    }
  },
  series: [{
      color: '#ddd',
      enableMouseTracking: false,
      showInLegend: false,
      data: [7, 7]
    }, {
      data: [1, 1]
    },
    {
      data: [2, 2]
    }
  ]

Demo: http://jsfiddle.net/BlackLabel/82svfyxt/

API References: https://api.highcharts.com/highcharts/series.bar.showInLegend https://api.highcharts.com/highcharts/series.bar.enableMouseTracking

Related