如图两条数据是两个不同时间周期获取到的结果,现在想在series中的data中添加自定义的标签 用于显示具体的日期 如1的日期为 2017-01-01,2016-12-01 ;2的日期为2017-01-02,2016-12-02 以此类推 在鼠标移动到数据中可以很直观的显示
大致效果如截图
配置项如下
option = {
"tooltip": {
"trigger": "axis"
},
"legend": {
"data": ["①提现", "②提现"]
},
"grid": {
"left": "3%",
"right": "3%",
"bottom": "3%",
"containLabel": "true"
},
"xAxis": {
"type": "category",
"boundaryGap": "false",
"data": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15]
},
"yAxis": {
"type": "value",
"axisLabel": {
"formatter": "{value} 元"
}
},
"series": [{
"name": "①提现",
"type": "line",
"data": [67.00, 43.00, 0.00, 0.00, 2.00, 73.00, 100.00, 18.00, 0.00, 92.00, 7.00, 7.00, 15.00, 10.00, 116.00]
}, {
"name": "②提现",
"type": "line",
"data": [98.00, 0.00, 103.00, 159.00, 0.00, 62.00, 0.00, 0.00, 42.00, 47.00, 54.00, 21.00, 0.00, 0.00, 51.00]
}]
};