RK.
RK.

Reputation: 981

HighCharts: Increase width and padding of stacked bar graph

I am trying to increase the width and padding of stacked bar graph but unable to get it. I have tried pointWidth and pointPadding property but it overlaps with each other if I try to give pointWidth: 20but it overlaps with each other instead of having padding among bars.

plotOptions: {

            series: {
                stacking: 'normal',
                 pointWidth: 15
                pointPadding: 0
            }
        },

Please look at the below link:

http://jsfiddle.net/rkahuja99/cmhbvqp7/

Any help will be highly appreciated.

Thanks.

Upvotes: 1

Views: 1619

Answers (1)

user4266696
user4266696

Reputation:

The height appears to be fixed rather than resizing to fit the contents. According to the documentation for chart.height:

By default the height is calculated from the offset height of the containing element, or 400 pixels if the containing element's height is 0.

Since you have specified the height of the containing element to be 400px, the bars cannot fit in the chart without overlapping.

Unfortunately, removing the height styling from the containing element does not cause the chart to resize itself to fit the contents either, as the container will have a height of zero by default, defaulting the chart height to 400px.

You'll have to set the height manually, either by increasing the container's height or by setting the height of the chart (any combination of these seem to work).

Upvotes: 1

Related Questions