I'm using Highcharts and I have a chart with a datetime axis. Most times the labels are correctly distributed along the axis with no overlap.
But sometimes it happens that labels overlap. Here you can see an example: http://jsfiddle.net/4ghhf/ Using tickInterval and tickPixelInterval doesn't solve the problem.
What should I do to avoid the problem?
I see two ways of fixing your problem :
I applied both in the following code (xAxis section) :
$(function () {
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'column'
},
xAxis: {
type: 'datetime',
tickInterval : 7*24 * 3600 * 1000,
labels : { y : 20, rotation: -45, align: 'right' }
},
series: [{
data: [
[Date.UTC(2010, 3, 11), 29.9],
[Date.UTC(2010, 4, 8), 71.5]
]
}]
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With