and1lea
Posts: 4
Joined: Wed Aug 03, 2022 11:57 am

Stacked bar configuration

Hi guys,

Have a problem with a stacked bar chart. I'm trying to use it with datetime data and percent stacking, but after setting '{ stacking: 'percent' }' param instead of 'normal' or 'true' chart, it does not show any data.
I tried to set min, max values for y-Axis, different formats of date(timestamp and classic date), etc. but still have a problem with showing and the percentage of my data.
Test code https://codepen.io/and1lea/pen/zYWWYje

Thanks
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: Stacked bar configuration

Hello,

Welcome to our forum and thank you for contacting us with your question.

Your chart works absolutely fine and behaves exactly how a stacked by percent bar chart should behave.

Stacking by percent means, that the columns/bars will stack on each other and extend themselves to 100% height of the chart. The height of the column is calculated by dividing the column value by the total stack value.

I'm guessing that you would like to display these percentages. That is another property called dataLabels. To display percent values you have to calculate and return them in dataLabels.formatter.

DEMO: https://jsfiddle.net/BlackLabel/zckd96Lh/
API Reference: https://api.highcharts.com/highcharts/p ... s.stacking
https://api.highcharts.com/highcharts/s ... .formatter

In case of any other questions, feel free to contact us!
Best regards
Kamil Musiałowski
Highcharts Developer

Return to “Highcharts Usage”