Вы установили tickInterval
из xAxis
на 7 дней, начиная с Date.UTC(2015, 8, 1)
до Date.UTC(2015, 8, 30)
, но установите pointStart
из series
, начиная с Date.UTC(2015, 1, 12)
.
Такпросто измените pointStart
на Date.UTC(2015, 8, 1)
.
Кстати, 7 * 24 * 3600 * 1000
составляет 7 дней.
(7 days * hours per day * seconds per hour * milliseconds per second)
$(function() {
$('#container').highcharts({
chart: {
type: 'line'
},
title: {
text: 'Monthly Average Rainfall'
},
subtitle: {
text: 'Source: WorldClimate.com'
},
xAxis: {
type: 'datetime',
gridLineWidth: 1,
min: Date.UTC(2015, 8, 1),
max: Date.UTC(2015, 8, 30),
dateTimeLabelFormats: {
second: '%H:%M:%S',
minute: '%H:%M',
hour: '%H:%M',
day: '%e. %b',
week: '%e. %b',
month: '%b \'%y',
year: '%Y'
},
tickInterval: 7 * 24 * 3600 * 1000 // interval of 1 day
},
yAxis: [{ // left y axis
title: {
text: null
},
labels: {
align: 'left',
x: 3,
y: 16,
format: '{value:.,0f}'
},
showFirstLabel: false
}, { // right y axis
linkedTo: 0,
gridLineWidth: 0,
opposite: true,
title: {
text: null
},
labels: {
align: 'right',
x: -3,
y: 16,
format: '{value:.,0f}'
},
showFirstLabel: false
}],
tooltip: {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}: </td>' +
'<td style="padding:0"><b>{point.y:.1f} mm</b></td></tr>',
footerFormat: '</table>',
shared: true,
useHTML: true
},
legend: {
align: 'left',
verticalAlign: 'top',
borderWidth: 0
},
/* plotOptions: {
column: {
pointPadding: 0,
borderWidth: 0,
groupPadding: 0.1,
//pointStart: Date.UTC(2015, 1, 12) // feb 12, 2015
}
}, */
plotOptions: {
series: {
cursor: 'pointer',
point: {
events: {
click: function(e) {
hs.htmlExpand(null, {
pageOrigin: {
x: e.pageX || e.clientX,
y: e.pageY || e.clientY
},
headingText: this.series.name,
maincontentText: Highcharts.dateFormat('%A, %b %e, %Y', this.x) + ':<br/> ' +
this.y + ' sessions',
width: 200
});
}
}
},
marker: {
lineWidth: 1
}
}
},
series: [{
name: 'Tokyo',
data: [
[Date.UTC(2015, 8, 1), 49.9],
[Date.UTC(2015, 8, 3), 71.5],
[Date.UTC(2015, 8, 5), 106.4],
[Date.UTC(2015, 8, 7), 129.2],
[Date.UTC(2015, 8, 9), 144.0],
[Date.UTC(2015, 8, 12), 176.0],
[Date.UTC(2015, 8, 15), 135.6],
[Date.UTC(2015, 8, 18), 148.5],
[Date.UTC(2015, 8, 21), 216.4],
[Date.UTC(2015, 8, 24), 194.1],
[Date.UTC(2015, 8, 27), 95.6],
[Date.UTC(2015, 8, 30), 54.4]
],
},
{
name: 'New York',
data: [83.6, 78.8, 98.5, 93.4, 106.0, 84.5, 105.0, 104.3, 91.2, 83.5, 106.6, 92.3],
pointStart: Date.UTC(2015, 8, 1),
pointInterval: 7 * 24 * 3600 * 1000 // interval of 1 day
}, {
name: 'London',
data: [48.9, 38.8, 39.3, 41.4, 47.0, 48.3, 59.0, 59.6, 52.4, 65.2, 59.3, 51.2],
pointStart: Date.UTC(2015, 8, 1),
pointInterval: 7 * 24 * 3600 * 1000 // interval of 1 day
}, {
name: 'Berlin',
data: [42.4, 33.2, 34.5, 39.7, 52.6, 75.5, 57.4, 60.4, 47.6, 39.1, 46.8, 51.1],
pointStart: Date.UTC(2015, 8, 1),
pointInterval: 7 * 24 * 3600 * 1000 // interval of 1 day
}
]
});
});
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>