echarts提示信息轮训显示
tooltip:{
trigger: 'item',
formatter : "{c} <br/> {b}",
position:function(point,params,dom,rect,size){
var marginW = Math.ceil(size.contentSize[0]/2);
var marginH = Math.ceil(size.contentSize[1]/2);
dom.style.marginLeft = "-" + marginW + 'px';
dom.style.marginTop = "-" + marginH + 'px';
dom.style.textAlign = 'center';
return ["35%","50%"];
},
alwaysShowContent: true,
textStyle:{
fontSize: 20,
color: "fff"
}
}
var currentIndex = -1;
var chartInterval;
vat chart = echarts.init(doucument.getElementById("main1"));
chartInterval = setInterval(function(){
var dataLength = option.series[0].data.length;
chart.dispatchAction({
type: "downplay",
seriseIndex: 0,
dataIndex = currentIndex
});
currentIndex = (currentIndex + 1) % dataLength;
chart.dispatchAction({
type: "highlight",
seriseIndex: 0,
dataIndex = currentIndex
});
chart.dispatchAction({
type: "showTip",
seriseIndex: 0,
dataIndex = currentIndex
});
if(currentIndex > dataLength){
currentIndex = -1;
}
$("#toolTipBox").animate({},function(){
$("#toolTipBox").css({'heigth':'20px','transform':'retate(360deg')})
});
}, 5000);