现在一业务需求,就是后台不断的推送数据,然后类似多个tooltip同时显示多个数据点的详细数据。
配置项如下
option = {
tooltip: {
show: true,
trigger:'axis',
alwaysShowContent:true
},
title: {
text: 'Awesome Chart'
},
xAxis: {
data: ['Sun', 'Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat']
},
yAxis: {},
series: [{
type: 'line',
data: [220, 182, 191, 234, 290, 330, 310]
}]
};
function autoTip() {
timer = setTimeout(function () {
//3.0以上版本的showTip使用方式
//如何让三个点同时显示?
myChart.dispatchAction({type: 'showTip', seriesIndex: 0, dataIndex: 0});
myChart.dispatchAction({type: 'showTip', seriesIndex: 0, dataIndex: 1});
myChart.dispatchAction({type: 'showTip', seriesIndex: 0, dataIndex: 3});
}, 1000);
}
autoTip();