G2 icon indicating copy to clipboard operation
G2 copied to clipboard

图例的Mode Api被删掉了嘛

Open harrylu99 opened this issue 3 years ago • 1 comments

  • [x] I have searched the issues of this repository and believe that this is not a duplicate.

What problem does this feature solve?

想在图例上实现单选的功能,看到旧版本是支持的

旧文档

现在文档中也没看到,加入后也不生效,是把这个功能删掉了嘛

What does the proposed API look like?

希望还可以继续支持这个功能

harrylu99 avatar Jan 05 '22 02:01 harrylu99

自己注册一个单选功能,就可以实现了。如下:单击单选,双击取消

    // 复写 图例筛选 交互。1、点击图例名称 进行 unchecked 状态的切换 2、点击图例 marker,进行 checked 状态的切换(进行聚焦)3、双击 重置状态
    chart.interaction('legend-filter', {
      start: [
        { trigger: 'legend-item:click', action: ['list-checked:checked', 'data-filter:filter'] },
      ],
      end: [{ trigger: 'legend-item:dblclick', action: ['list-checked:reset', 'data-filter:filter'] }],
    });

visiky avatar Jan 06 '22 15:01 visiky