react实现柱状图点击阴影 react echarts阴影点击
首页 > >    作者:lininn   2019年6月26日 10:48 星期三   热度:2819°   百度已收录  
时间:2019-6-26 10:48   热度:2819° 

render(){

return(
<div>
<EchartsReact option={option} ref={(e) => {
this.echartsReactRef = e;//chu
}} style={{height:2+"rem",width:'100%'}}/>
</div>
)

}

componentDidMount() {
this.echartsInstance = this.echartsReactRef.getEchartsInstance();
this.zr = this.echartsInstance.getZr();

this.zr.on('click', (...rest) => {
var pointInPixel= [rest.offsetX, rest.offsetY];
var xIndex=this.echartsInstance.convertFromPixel({seriesIndex:0},[rest[0].offsetX, rest[0].offsetY]);
var index=parseInt(xIndex);
console.log(index);
console.log('App:onClickChart', rest);
});
}

二维码加载中...
本文作者:lininn      文章标题: react实现柱状图点击阴影 react echarts阴影点击
本文地址:?post=359
版权声明:若无注明,本文皆为“覆手为雨”原创,转载请保留文章出处。
分享本文至:

返回顶部    首页    手机版本    后花园   会员注册   
版权所有:覆手为雨    站长: lininn