DhanashriSakh
Posts: 42
Joined: Mon Jun 13, 2022 11:40 am

How to add groupPadding on category axis

Now i can give space between a particular series but now i need to give space as per attribute ,if two series are there i want space while grouping not for every series
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: How to add groupPadding on category axis

Hi there,

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

It is hard to understand what you are trying to achieve without any images or code references. Could you please share some screenshots with guidelines, so that I can help you create the desired chart?

Thank you,
Regards!
Kamil Musiałowski
Highcharts Developer
DhanashriSakh
Posts: 42
Joined: Mon Jun 13, 2022 11:40 am

Re: How to add groupPadding on category axis

https://ibb.co/JH9Lhxf

this is image i had applied groupPadding :40 in

Code: Select all

plotOptions: {
            series: {
                groupPadding: 40
            }
  },
So , we can see that padding is aaplying equal for every series as on x axis i want padding as per the category axis , as image shows Books having Two metric soo, distance should be in beween Books and Electronics not for every series.
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: How to add groupPadding on category axis

Please take a look at the demo linked below. Is that what you wanted to achieve?

groupPadding and pointPadding options cannot exceed 0.5, so the value of 40 definitely won't work. Play around with those values in the provided demo.

Values provided in these options are percentages of padding that should be left on both sides of the columns group.

DEMO: https://jsfiddle.net/BlackLabel/kq45p6be/
API Reference: https://api.highcharts.com/highcharts/s ... oupPadding
https://api.highcharts.com/highcharts/s ... intPadding

Let me know if that's what you were looking for,
Regards!
Kamil Musiałowski
Highcharts Developer
DhanashriSakh
Posts: 42
Joined: Mon Jun 13, 2022 11:40 am

Re: How to add groupPadding on category axis

Thank you
Kamil Musiałowski,

This is what i want to achieve and it is working fine with this two property.
I want to ask as you said max value we can take 0.5 but after taking 0.5 chart looks like this
Image ,
so is it normal with 0.5 will stacked the metrics with small width bar.
DhanashriSakh
Posts: 42
Joined: Mon Jun 13, 2022 11:40 am

Re: How to add groupPadding on category axis

with 0.5 groupPadding chart look like this
https://ibb.co/TqLN1p7
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: How to add groupPadding on category axis

You're welcome!

From a mathematical point of view, the max value is 0.5, but you will end up with a 1px column, so realistically the max value (depending on your columns width) will oscillate around 0.4.

You have to play around with the values, depending on your columns width config.

I hope that you will find it useful,
Best regards!
Kamil Musiałowski
Highcharts Developer
DhanashriSakh
Posts: 42
Joined: Mon Jun 13, 2022 11:40 am

Re: How to add groupPadding on category axis

Ok i had given default 0.4 as per column width , It is working fine.

Thanks for your quick response and Helping with better solution!
kamil.m
Posts: 892
Joined: Thu May 19, 2022 1:33 pm

Re: How to add groupPadding on category axis

Good to hear that you've found a right setting for your project!

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

Return to “Highcharts Usage”