Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

希望提供 legend的反选按钮 #8837

Closed
huntergd opened this issue Aug 9, 2018 · 3 comments
Closed

希望提供 legend的反选按钮 #8837

huntergd opened this issue Aug 9, 2018 · 3 comments

Comments

@huntergd
Copy link

huntergd commented Aug 9, 2018

One-line summary [问题简述]

我的lengend很多,大于10个,我想看到某一个legend,目前的做法,是先把不想看的逐个点,灰掉,才能看到我想看那个,需要操作10多步。希望提供全反选,一键灰 掉所有legend,然后选择想看按个,减少到2步完成。

Version & Environment [版本及环境]

  • ECharts version [ECharts 版本]:4
  • Browser version [浏览器类型和版本]:chrome 最新版
  • OS Version [操作系统类型和版本]:win10
@Ovilia
Copy link
Contributor

Ovilia commented Aug 9, 2018

目前界面上有点不好放按钮,有看到过类似的设计吗?自己倒是可以在外面增加一个按钮控制全选全灰,然后调用 http://echarts.baidu.com/api.html#action.legend

@Ovilia Ovilia closed this as completed Aug 29, 2018
@PikachuHy
Copy link

樓上正解

        const legends = this.data.columns
        for (let i = 1; i < legends.length; i++) {
          this.echart.dispatchAction({
            type: 'legendToggleSelect',
            // 图例名称
            name: legends[i]
          })
        }

@ghost
Copy link

ghost commented Aug 20, 2019

樓上正解

        const legends = this.data.columns
        for (let i = 1; i < legends.length; i++) {
          this.echart.dispatchAction({
            type: 'legendToggleSelect',
            // 图例名称
            name: legends[i]
          })
        }

请问 this.data.columns 怎么获取到?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants