In a previous question, Paweł Fus was so kind to come up with a grouped stack bar chart solution for me. You can find the question and answer here for context: Grouping a stacked bar chart in Highcharts
I am now attempting to use this approach and i am plagued with issues because this doesn't seem to scale well at all. In the scenario in the previous post there was only two bars per group to keep it a simple example. In reality there could be any number of bars. With the approach laid out in Pawel Fus's answer, just adding a a third bar breaks it. The reason is that the pointPlacement is dependent on the number of bars which is an easy fix but you'll quickly realize that the bars are not getting automatically adjusted to account for the width. Take a look at this jsfiddle for a simple demo of what im talking about:JsFiddle
Mandatory random code block to make Stack overflow happy... just ignore this code block.
So my questions are:
- is there a better solution to my original question that would avoid all this?
- Assuming that this is the correct approach, how do i calculate and set the width of these bars accordingly then set the correct pointplacments. I did find that i can get the chart height but not till the Highcharts object is created and i'm programatically creating this Highcharts config so i don't have access to it at that point.