1、地图
let total = 3; // series.data.length
let count = 0;
let count1 = -1;
let countCourt_setInterval1 = null;
let countCourt_setInterval2 = null;
function autoTip() {
countCourt_setInterval1 = setInterval(function() {
let curr = count % total;
countCourtChart.dispatchAction({
type: 'mapSelect',
seriesIndex: 0, // 因为只有一组数据,所以此处应为0
dataIndex: curr
});
count += 1;
}, 3000);
countCourt_setInterval2 = setInterval(function() {
let curr1 = count1 % total;
console.info("curr1:"+curr1);
countCourtChart.dispatchAction({
type: 'mapUnSelect',
seriesIndex: 0, // 因为只有一组数据,所以此处应为0
dataIndex: curr1
});
count1 += 1;
}, 3000);
}
autoTip();
2、折线图
let countTaskByMonth_count = 0;
let countTaskByMonth_total = dataInit.length; // series.data.length
function autoTip() {
countTaskByMonth_setInterval = setInterval(function() {
let curr = countTaskByMonth_count % countTaskByMonth_total;
myChart5.dispatchAction({
type: 'showTip',
seriesIndex: 0, // 因为只有一组数据,所以此处应为0
dataIndex: curr
});
countTaskByMonth_count += 1;
}, 3000);
}
autoTip();
3、环形图(饼图)
高亮:
myChart.dispatchAction({type:'showTip',seriesIndex: _index ,dataIndex: 1});
myChart.dispatchAction({type: 'highlight',seriesIndex: _index,dataIndex: 1});
取消高亮:
myChart.dispatchAction({type:'hideTip',seriesIndex: _index,dataIndex: 1});
myChart.dispatchAction({type: 'downplay',seriesIndex: _index,dataIndex: 1});