I want a highcharts graph, to start and end on tick, and have the final x limit equal to the max value.
Even though my configuration has:
max: 11,
endOnTick: true
I found that the actual final value of the graph is 12. How do I make it to be 11 without having to change endOnTick to false?
Example:
/
Thanks in advance.
I want a highcharts graph, to start and end on tick, and have the final x limit equal to the max value.
Even though my configuration has:
max: 11,
endOnTick: true
I found that the actual final value of the graph is 12. How do I make it to be 11 without having to change endOnTick to false?
Example:
http://jsfiddle/5VVMm/
Thanks in advance.
Share asked Nov 8, 2013 at 8:02 maranomarano 7426 silver badges9 bronze badges 1- In case you want to start from 0 and and on 11, what should be between? Between 0 and 11 there is no 'nice labels'. If you don't like solution provided by Highcharts, see that answer. I think that first options suits you the best. – Paweł Fus Commented Nov 8, 2013 at 9:48
1 Answer
Reset to default 4Easiest way is to use predefined tickInterval
, following will do:
xAxis: {
min: 0,
step: 2,
max: 11,
startOnTick: true,
endOnTick: true,
tickInterval: 1
}
A little bit trickier is tickPixelInterval
usage, in your case 50 will do.
Things bee even more plicated, if your chart is scalable/zoomable. You'll have to write custom event handler to update those properties, to ensure that your tickInterval
is diveder to your data range (if it's even possible, i.e. data range is integer, not float) to ensure that your last tick equals max axis value.
发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744915454a4600804.html
评论列表(0条)