记录一次echarts 中bar 定时跳跃并显示内容
查看echarts api ----- https://www.echartsjs.com/zh/api.html#echarts
搜索
1.dispatchAction 执行的关键
2.highlight 变换显示的关键
3.tooltip 变幻时 显示提示框的关键
关键代码:
1. myChartSalarypie.setOption({}); 设置自己的的option 内容
2. myChartSalarypie.dispatchAction({type: 'downplay',seriesIndex: 0,dataIndex: curIndex});
3.myChartSalarypie.dispatchAction({type: 'highlight',seriesIndex: 0,dataIndex: curIndex});
4.myChartSalarypie.dispatchAction({
type:'showTip',
seriesIndex:0,
dataIndex:curIndex
});
跳动的完整代码:
if( runFlag !=null )
{
clearInterval(runFlag);
runFlag = null ;
}
if(curIndex == null) {
myChartSalarypie.dispatchAction({type: 'highlight',seriesIndex: 0,dataIndex: 0});
}
else {
myChartSalarypie.dispatchAction({type: 'highlight',seriesIndex: 0,dataIndex: curIndex});
myChartSalarypie.dispatchAction({
type:'showTip',
seriesIndex:0,
dataIndex:curIndex
});
runFlag = setInterval(function () {
var dataLen = showDate.length;
// 取消高亮
myChartSalarypie.dispatchAction({type: 'downplay',seriesIndex: 0,dataIndex: curIndex});
curIndex = (curIndex + 1) % dataLen;
//设置高亮
myChartSalarypie.dispatchAction({type: 'highlight',seriesIndex: 0,dataIndex: curIndex});
myChartSalarypie.dispatchAction({
type:'showTip',
seriesIndex:0,
dataIndex:curIndex
});
}, 3000);
}
openRunFlag=false;
最新文章
- paramiko 的使用
- EXCEL里面的数字显示为文本 不用科学计数法显示
- ul li 下的元素内容垂直居中
- jQuery对话框插件 ThickBox
- JQuery初探
- Enum:Backward Digit Sums(POJ 3187)
- 【转】SSM框架——详细整合教程(Spring+SpringMVC+MyBatis)
- 从Windows 8 安装光盘安装.NET Framework 3.5.1
- 我的Blog开张啦,欢迎大家赏脸
- MVC 构造
- Android init进程概述
- JS时间的计算,当前日期加一天或者几天的计算
- 【C#基础】HTTP发送POST二进制数据
- 深圳尚学堂:Java中Class对象
- JDK配置测试
- LEDAPS1.3.0版本移植到windows平台----HuSr大气校正模块
- Laravel 系列入门教程(五)【最适合中国人的 Laravel 教程】
- [转帖]数据中心网络里的Underlay和Overlay
- Python爬虫实战(一):爬糗事百科段子
- 对微软Microsoft Dynamics CRM 的认识