antvis/G2

[v5] 调用 changeData 后,图例没有同步更新。 #4939

pepper-nice posted onGitHub

代码

const chart = new Chart({ theme: 'classic', container: div, canvas });
chart.data([
  { genre: 'Sports', sold: 275 },
  { genre: 'Strategy', sold: 115 },
  { genre: 'Action', sold: 120 },
  { genre: 'Shooter', sold: 350 },
  { genre: 'Other', sold: 150 },
]);
const interval = chart
  .interval()
  .encode('x', 'genre')
  .encode('y', 'sold')
  .encode('color', 'genre');
const finished = chart.render();
button.onclick = () => {
  interval.changeData([
    { genre: 'Action', sold: 120 },
    { genre: 'Shooter', sold: 350 },
  ]);
};

现象

iShot_2023-05-05_09 54 08


同样的问题,在v5.0.6有,暂时只能退回到5.0.5了~。

posted by soonio almost 2 years ago

同样的问题,在v5.0.6有,暂时只能退回到5.0.5了~。

问题已修复,安装最新依赖试试。

posted by pepper-nice almost 2 years ago

同样的问题,在v5.0.6有,暂时只能退回到5.0.5了~。

问题已修复,安装最新依赖试试。

目前还没有修复哈,等这个 PR 合并:https://github.com/antvis/G2/pull/5002

posted by pearmini almost 2 years ago

Fund this Issue

$0.00
Funded

Pull requests