You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/03/11 08:18:00 UTC

[GitHub] [incubator-echarts] jiankang-wang commented on issue #5582: 折线图如何在鼠标经过其中的某一条折线的时候,让对应的折线变粗

jiankang-wang commented on issue #5582: 折线图如何在鼠标经过其中的某一条折线的时候,让对应的折线变粗
URL: https://github.com/apache/incubator-echarts/issues/5582#issuecomment-597500816
 
 
   可以利用事件监听:
   
   `
   let currentEcharts = null;
   
   const onEvents = {
     mouseover: (e) => {
       currentEcharts.getEchartsInstance().setOption({
         series: {
           name: e.seriesName,
           symbolSize: 6,
           lineStyle: {
             width: 6,
           },
         },
       });
     },
     mouseout: (e) => {
       currentEcharts.getEchartsInstance().setOption({
         series: {
           name: e.seriesName,
           symbolSize: 4,
           lineStyle: {
             width: 2,
           },
         },
       });
     },
   };
   
                <ReactEcharts
                  style={{ minHeight: '500px' }}
                  theme={echartsTheme.themeName}
                  option={this.getOption()}
                  ref={(e) => { currentEcharts = e; }}
                  onEvents={onEvents}
                />
   `

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services

---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org