-1

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.

Garo Gabrielyan
  • 466
  • 2
  • 7
  • 20

1 Answers1

1

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: https://jsfiddle.net/BlackLabel/7vx2sn8d/

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

magdalena
  • 2,657
  • 1
  • 7
  • 12