echarts 常用API action 之 disp

2020-03-05  本文已影响0人  家有饿犬和聋猫

echarts中支持的图表行为,通过dispatchAction触发。
特定位置高亮或者显示提示框

 getChartObjs = (echartObj)=> {
        let {selectData: {seriesName}, type} = this.state;
        toolTipTimer = setTimeout(()=>{
            echartObj.dispatchAction({
                type: 'showTip',         //提示框
                seriesIndex: 0,
                dataIndex: lightIndex     //第 lightIndex   柱子高亮
            });}
        }, 300);
   
 <BBDLineBar option={barOption} key={key} lightIndex={lightIndex} getChartObj={this.getChartObjs.bind(this)} />
效果图 image.png

hideTip 隐藏提示框

dispatchAction({
type:'hideTip'
})

更多功能 https://www.cnblogs.com/sminocence/p/11230730.html

上一篇 下一篇

猜你喜欢

热点阅读