var chart = new Highcharts.Chart({
chart: {
renderTo: container
},
plotOptions: {
series: {
pointStart: Date.UTC(2010, 0, 1),
pointInterval: 24 * 3600 * 1000 * 1 // one day
}
},
xAxis: {
type: 'datetime',
dateTimeLabelFormats: { // don't display the dummy year
day: '%b %e',
},
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}, {
data: [144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4, 29.9, 71.5, 106.4, 129.2]
}]
the code upper work good, However when i change pointInterval to 24 * 3600 * 1000 * 7 (1 week), the highchart dateTimeLabelFormat don't work, any help
It doesn't work because you are setting label format for one day interval, while used is week format, see fixed example: http://jsfiddle.net/F2uMR/1/
$('#container').highcharts({
xAxis: {
type: 'datetime',
dateTimeLabelFormats: {
day: '%b %e',
week: '%b %e'
}
},
series: [{
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
pointStart: Date.UTC(2010, 0, 1),
pointInterval: 24 * 3600 * 1000 * 7// one week
}]
});
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