jgosar
Posts: 22
Joined: Wed Oct 27, 2010 12:14 pm

Columns at the edge are cut off

Hello!

We have a column chart with a datetime axis because we need to display some information for every month. The problem is that the left- and rightmost columns are narrower, it looks like they are cut off at the edge. What can i do to make them display normally?

This is what the chart looks like now:
Image

Thanks for your help!
hfrntt
Posts: 6393
Joined: Mon Aug 30, 2010 8:41 am
Contact: Website

Re: Columns at the edge are cut off

Add categories: [] to your xAxis options.
Slawek Kolodziej
Highcharts support team
jgosar
Posts: 22
Joined: Wed Oct 27, 2010 12:14 pm

Re: Columns at the edge are cut off

Hello!

First of all sorry for the late reply, but i couldn't test your solution earlier because of technical difficulties.

It didn't help, there is still the same problem, and also the X axis loses its labels.
Image
hfrntt
Posts: 6393
Joined: Mon Aug 30, 2010 8:41 am
Contact: Website

Re: Columns at the edge are cut off

In the first post you wrote that you used datetime axis. So now it don't disapear, you just see real datetime labels now. Could you post your chart code or make an example of your chart on jsfiddle.net?
Slawek Kolodziej
Highcharts support team
jlbriggs
Posts: 1465
Joined: Tue Sep 21, 2010 2:33 pm

Re: Columns at the edge are cut off

Is there a good reason that the columns behave that way when categories are not used?
I've run into this a few times, and have solved it by adding categories, but it seems like a very silly default behavior...
fiddles: http://jsfiddle.net/jlbriggs/J9JLr/
hfrntt
Posts: 6393
Joined: Mon Aug 30, 2010 8:41 am
Contact: Website

Re: Columns at the edge are cut off

It happens because on non-categorized xAxis columns and ticks are centered and first tick is aligned to the left (last to the right). It can be solved by adding this "categories: []" or by using minPadding & maxPadding (like here: http://jsfiddle.net/F6esB )
Slawek Kolodziej
Highcharts support team
torstein.honsi
Site Admin
Posts: 9215
Joined: Thu Nov 09, 2006 11:22 am
Location: Vik i Sogn, Norway

Re: Columns at the edge are cut off

In version 2.1, the axis will detect if a column series is present and add the padding like if there were categories.
Torstein Hønsi
CTO, Founder
Highsoft
jgosar
Posts: 22
Joined: Wed Oct 27, 2010 12:14 pm

Re: Columns at the edge are cut off

hfrntt wrote:It happens because on non-categorized xAxis columns and ticks are centered and first tick is aligned to the left (last to the right). It can be solved by adding this "categories: []" or by using minPadding & maxPadding (like here: http://jsfiddle.net/F6esB )

Thanks, that helped :)
cmracar
Posts: 2
Joined: Tue May 17, 2022 12:13 pm

Re: Columns at the edge are cut off

hfrntt wrote: Tue Nov 02, 2010 7:46 pm It happens because on non-categorized xAxis columns and ticks are centered and first tick is aligned to the left (last to the right). It can be solved by adding this "categories: []" or by using minPadding & maxPadding (like here: http://jsfiddle.net/F6esB )
Thank you for your answer. I solved using minPadding & maxPadding
mateusz.b
Posts: 2006
Joined: Tue Jul 13, 2021 11:34 am

Re: Columns at the edge are cut off

Hi cmracar,

Glad to hear it helped you. In case of any questions feel free to contact us anytime.

Regards!
Mateusz Bernacik
Highcharts Developer

Return to “Highcharts Usage”