可以再label标签里,用
formatter
: Function坐标轴标签格式化回调函数。在该函数里,坐标轴的值可以通过 this.value
来获取;通过 this
还可以获取更多信息,包括this.axis
、this.chart
、this.isFirst
、this.isLast
。默认的格式化结果可以通过调用this.axis.defaultLabelFormatter.call(this)
来获取。
xAxis: {
type: 'datetime',
tickPixelInterval: 150,
labels: {
formatter: function () { alert(22);
return Highcharts.dateFormat('%Y-%m-%d', this.value);
}
}
},