echarts icon indicating copy to clipboard operation
echarts copied to clipboard

[Feature] I think custom chart can add a `LegendVisualProvider` factory

Open halo951 opened this issue 2 years ago • 1 comments

What problem does this feature solve?

碰见一个问题, 在使用 Series.Custom 开发自定义样式的饼图时, 使用Legends组件只能映射到 series.name. 没有映射到 dataset 上面, 考虑到 Custom 图 是为了应对特殊场景下echarts官方提供的Chart无法满足使用的情况, Legends 只映射到Legend可以理解。 但是有一个更好的想法, 在 Custom Chart 的配置项中, 暴露一个LegendVisualProvider的接口, 允许引入自定义的LegendVisualProvider实例, 就可以满足 Custom Chart 自定义legend功能.

What does the proposed API look like?

{
  series: [
      {
         type: 'custom',
         legendVisualProvider: new LegendVisualProvider(...)
      }
  ]
}

halo951 avatar May 19 '22 04:05 halo951