选项如下所示:
var chartOptions = {
chart: {
backgroundColor: 'white',
type:'line'
},
title: {
text:null
},
xAxis: {
gridLineWidth:0.5,
gridLineColor:'#e1e1e1',
tickInterval:intervalPeriod,
tickWidth: 0,
type: 'datetime',
dateTimeLabelFormats: dateTimeLabelFormats
},
yAxis: {
gridLineWidth:0.5,
gridLineColor:'#e1e1e1',
allowDecimals:false,
tickAmount: 5,
title: {
text: null
}
},
tooltip:{
shared:true,
xDateFormat:'%e %b, %Y',
crosshairs:true
}
}
答案 0 :(得分:0)
您需要为tickInterval
和pointInterval
设置相同的值才能显示与系列点同步的标记。当点具有不规则的间隔时,您可以使用tickPositions
数组。
API参考:
http://api.highcharts.com/highcharts/xAxis.tickInterval
http://api.highcharts.com/highcharts/plotOptions.series.pointInterval
http://api.highcharts.com/highcharts/xAxis.tickPositions
例:
http://jsfiddle.net/zycwaexa/ - 使用相同的tickInterval
和pointInterval
http://jsfiddle.net/z7pnwtrs/ - 使用tickPositions