It is currently Mon Dec 11, 2017 5:01 pm Advanced search

Y-axis and X-axis padding on XRange chart

Technical support, bug reports and more.

Y-axis and X-axis padding on XRange chart

Postby lanimr » Mon Oct 09, 2017 8:59 pm

I'm trying to make the x-axis on an XRange chart start on tick and end on tick. I've enabled startOnTick and endOnTick on the x-axis, and I've also set pointPlacement to 'on', but doing this seems to affect the padding on the y-axis as well.

JSFiddle:
http://jsfiddle.net/lanimelrok/5qbn1bst/1/


How can I configure it so that the x-axis starts and ends on ticks without affecting the y-axis padding?
lanimr
 
Posts: 16
Joined: Tue Feb 07, 2017 9:59 pm

Re: Y-axis and X-axis padding on XRange chart

Postby ppotaczek » Wed Oct 11, 2017 12:07 pm

Hi lanimr,

I got the result which you want by used Highcharts.Axis#setExtremes method.

Live demo: http://jsfiddle.net/ppotaczek/5qbn1bst/2/
Docs: http://api.highcharts.com/class-referen ... etExtremes
http://api.highcharts.com/class-referen ... etExtremes

Best regards!
Paweł Potaczek,
Highcharts Developer
ppotaczek
 
Posts: 154
Joined: Mon Oct 02, 2017 5:12 pm

Re: Y-axis and X-axis padding on XRange chart

Postby lanimr » Thu Oct 12, 2017 1:57 am

Thank you for your response!

I'm not sure if I'm missing something, but in the demo you provided, the x-axis still doesn't start/end on ticks, and the y-axis padding is still messed up. Any ideas?
lanimr
 
Posts: 16
Joined: Tue Feb 07, 2017 9:59 pm

Re: Y-axis and X-axis padding on XRange chart

Postby ppotaczek » Thu Oct 12, 2017 2:04 pm

Hi lanimr,

Sorry for misunderstanding the question. I hope this post will solve your problem.
To make the x-axis on an XRange chart start on tick and end on tick you should set series.pointRange to 1.
PointRange is automatically calculating on datetime axis on XRange chart in this way:

Code: Select all
pointRange: 24 * 3600 * 1000


Live demo: http://jsfiddle.net/ppotaczek/5qbn1bst/5/
Docs: http://api.highcharts.com/highcharts/se ... pointRange

Best regards!
Paweł Potaczek,
Highcharts Developer
ppotaczek
 
Posts: 154
Joined: Mon Oct 02, 2017 5:12 pm

Re: Y-axis and X-axis padding on XRange chart

Postby lanimr » Thu Oct 12, 2017 7:58 pm

This worked, thank you so much!!
lanimr
 
Posts: 16
Joined: Tue Feb 07, 2017 9:59 pm


Return to Highcharts Usage

Who is online

Users browsing this forum: Bing [Bot], Google [Bot] and 6 guests