xAxis: {
labels: {
formatter: function() {
//获取到刻度值
var labelVal = this.value;
console.log(this);
//实际返回的刻度值
let xdatas=["2020-10-01 08:15:06:201-5","2020-10-01 08:15:06:201-6","2020-10-01 08:15:06:201-7"
,"2020-10-01 08:15:06:201-8","2020-10-01 08:15:06:201-9","2020-10-01 08:15:06:201-10"
,"2020-10-01 08:15:06:202-8","2020-10-01 08:15:06:203-9","2020-10-01 08:15:06:204-10"];
var reallyVal = xdatas[labelVal];
//判断刻度值的长度
return reallyVal;
}
}
},
tooltip: {
split: false
},
series: [{
data: [ 0.7695, 0.7648,0.7645, 0.7638, 0.7645, 0.79, 0.79, 0.79, 0.79, 0.79],
id: 'dataseries'
}, {
type: 'flags',
data: [{
x: 1,
title: 'C',
text: 'Stocks fall on Greece, rate concerns; US dollar dips'
},{
x: 3,
title: 'C',
text: 'Stocks fall on Greece, rate concerns; US dollar dips'
},{
x: 4,
title: 'C',
text: 'Stocks fall on Greece, rate concerns; US dollar dips'
}],
onSeries: 'dataseries',
shape: 'circlepin',
width: 16
}]