antvis/G2

composite mark 交互不生效 #5463

pearmini posted onGitHub

复合 Mark 的 legendFilter 交互失效:

<img src="https://github.com/antvis/G2/assets/49330279/dbc5d29c-b5fe-439a-9863-9bab4d5092ff" width=640 />

function Pie(options, context) {
  const { encode = {}, ...rest } = options;
  const { value, ...restEncode } = encode;
  return deepMix(rest, {
    type: 'interval',
    transform: [{ type: 'stackY' }],
    coordinate: { type: 'theta' },
    encode: {
      ...restEncode,
      y: value,
    },
  });
}

const chart = new Chart({ container, canvas });

chart.options({
  type: Pie,
  data: [
    { genre: 'Sports', sold: 275 },
    { genre: 'Strategy', sold: 115 },
    { genre: 'Action', sold: 120 },
    { genre: 'Shooter', sold: 350 },
    { genre: 'Other', sold: 150 },
  ],
  // @ts-ignore
  encode: { value: 'sold', color: 'genre' },
});

可能和交互的传递有关系。

posted by pearmini over 1 year ago

Fund this Issue

$0.00
Funded

Pull requests