apache / echarts

Apache ECharts is a powerful, interactive charting and data visualization library for browser
https://echarts.apache.org
Apache License 2.0
60.63k stars 19.61k forks source link

多series对象,legend鼠标悬浮两个esries图表只有第一个联动,第二个未联动 #9868

Closed dreamchen closed 3 years ago

dreamchen commented 5 years ago

General Questions

Issue Type

Issue Details

Expected Behavior

鼠标在legend悬浮,两个图标都联动显示选中状态提示信息

Current Behavior

只有第一个显示选中状态提示信息,如图: image

Online Example

没有线上环境

let legend = this.merchantPieData[0].value.map(_ => _.name)
        let option = {
          title: {
            text: '商家调用占比',
            subtext: '总量(左) / 今日(右)',
            x: 'center'
          },
          tooltip: {
            trigger: 'item',
            formatter: '{a} <br/>{b} : {c} ({d}%)'
          },
          legend: {
            orient: 'horizontal',
            bottom: 10,
            left: 'center',
            data: legend
          },
          series: [
            {
              name: this.merchantPieData[0].name,
              type: 'pie',
              radius: '50%',
              center: ['20%', '50%'],
              label: {
                normal: {
                  show: false
                },
                emphasis: {
                  show: true
                }
              },
              lableLine: {
                normal: {
                  show: false
                },
                emphasis: {
                  show: true
                }
              },
              data: this.merchantPieData[0].value,
              selectedMode: 'single',
              itemStyle: {
                emphasis: {
                  shadowBlur: 10,
                  shadowOffsetX: 0,
                  shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
              }
            },
            {
              name: this.merchantPieData[1].name,
              type: 'pie',
              radius: '50%',
              center: ['75%', '50%'],
              label: {
                normal: {
                  show: false
                },
                emphasis: {
                  show: true
                }
              },
              lableLine: {
                normal: {
                  show: false
                },
                emphasis: {
                  show: true
                }
              },
              data: this.merchantPieData[1].value,
              selectedMode: 'single',
              itemStyle: {
                emphasis: {
                  shadowBlur: 10,
                  shadowOffsetX: 0,
                  shadowColor: 'rgba(0, 0, 0, 0.5)'
                }
              }
            }
          ]
        }
        this.merchantDom = echarts.init(this.$refs.merchantDom, 'tdTheme')
        this.merchantDom.setOption(option)

Topics

Anything Else We Need to Know

两个图表legend都一致,鼠标悬浮到legend上后只有图表1显示联动选中状态,图表二无响应

Environment

634323580 commented 5 years ago

我也遇到了一样的问题,请问 @dreamchen 解决了吗?

ciel-he commented 5 years ago

同问,请问解决了吗?本来想用这个例子:https://echarts.apache.org/examples/zh/editor.html?c=dataset-default,结果这个放到react-echarts中不显示

dreamchen commented 5 years ago

代码存在bug,升级最新版本后即可解决。

heye1109 notifications@github.com 于2019年7月29日周一 下午5:35写道:

同问,请问解决了吗?本来想用这个例子: https://echarts.apache.org/examples/zh/editor.html?c=dataset-default,结果这个放到react-echarts中不显示

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/apache/incubator-echarts/issues/9868?email_source=notifications&email_token=ABDKZKJ23HDG45F5XAUYCALQB22V5A5CNFSM4GTCV7CKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD3AE7RQ#issuecomment-515919814, or mute the thread https://github.com/notifications/unsubscribe-auth/ABDKZKJ3EKLM6BGP5F4Y2Q3QB22V5ANCNFSM4GTCV7CA .

github-actions[bot] commented 3 years ago

This issue has been automatically marked as stale because it did not have recent activity. It will be closed in 7 days if no further activity occurs. If you wish not to mark it as stale, please leave a comment in this issue.

github-actions[bot] commented 3 years ago

This issue has been automatically closed because it did not have recent activity. If this remains to be a problem with the latest version of Apache ECharts, please open a new issue and link this to it. Thanks!