Javascript 我不知道';我不明白为什么选择间隔和';dot';在图形上是否未对齐?
我不明白为什么图上的间隔和点不对齐 从中可以看出,“2月10日”的数据与“2月10日”的刻度区间不一致Javascript 我不知道';我不明白为什么选择间隔和';dot';在图形上是否未对齐?,javascript,highcharts,jsfiddle,Javascript,Highcharts,Jsfiddle,我不明白为什么图上的间隔和点不对齐 从中可以看出,“2月10日”的数据与“2月10日”的刻度区间不一致 $('#container').highcharts({ chart: { backgroundColor: '#fff', borderWidth: 0, plotBackgroundColor: '#fff', plotShadow: false, plotBo
$('#container').highcharts({
chart: {
backgroundColor: '#fff',
borderWidth: 0,
plotBackgroundColor: '#fff',
plotShadow: false,
plotBorderWidth: 0
},
title: {
text: '',
x: -20 //center
},
subtitle: {
text: '',
x: -20
},
xAxis: {
gridLineWidth: 0,
type: 'datetime',
dateTimeLabelFormats: {
day: '%e. %b',
week: '%e. %b',
month: '%b \'%y',
year: '%Y'
}
},
yAxis: {
minorTickInterval: 1,
lineWidth: 0,
tickWidth: 0,
title: {
text: ''
},
plotLines: [{
value: 0,
width: 1,
color: '#808080'
}]
},
tooltip: {
valueSuffix: '°C'
},
legend: {
layout: 'horizontal',
align: 'top',
verticalAlign: 'top',
borderWidth: 0
},
navigation: {
buttonOptions: {
enabled: false
}
},
series: [
{
name: 'Logins',
data: [[1391407200000, 2],
[1391493600000, 2],
[1391580000000, 1],
[1392012000000, 1],
[1392098400000, 2],
[1392184800000, 1],
[1392271200000, 2],
[1392357600000, 1],
[1392616800000, 3],
[1392789600000, 1],
[1392876000000, 1],
[1393221600000, 2],
[1393308000000, 3],
[1393394400000, 1],
[1393480800000, 1]],
pointInterval: 86400000,
pointStart: 1391212800000
}
]
});
这是因为x轴上记号处的时间戳与该点的时间戳不同
我已经更新了你的小提琴,这样原因就会清楚了时间与00:00:00相符吗?如果是:你确定时区匹配吗?不,我不确定时区。我如何匹配时区?是的,我明白你的意思,但我不明白为什么我在Javascript和Mysql中得到不同的时间戳。我已将mysql数据库时区更新为UTC以解决此问题。