Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

【v5】chart.clear 之后调用 chart.render 报错 #5296

Closed
Deathsteps opened this issue Jul 11, 2023 · 0 comments
Closed

【v5】chart.clear 之后调用 chart.render 报错 #5296

Deathsteps opened this issue Jul 11, 2023 · 0 comments

Comments

@Deathsteps
Copy link
Contributor

问题描述

chart.clear 之后调用 chart.render ,无法重新渲染,控制台报 theme 错误。(在 chart.render 前调用 chart.interval 等重新设置也一样)

image

期望结果

可以正常 clear 重绘

如何重现

官方代码修改

/**
 * A recreation of this demo: https://observablehq.com/@d3/bar-chart
 */
import { Chart } from '@antv/g2';

const chart = new Chart({
  container: 'container',
  theme: 'classic',
  autoFit: true,
});

chart
  .interval()
  .data({
    type: 'fetch',
    value:
      'https://gw.alipayobjects.com/os/bmw-prod/fb9db6b7-23a5-4c23-bbef-c54a55fee580.csv',
  })
  .encode('x', 'letter')
  .encode('y', 'frequency')
  .axis('y', { labelFormatter: '.0%' });

chart.render();

setTimeout(() => {
  chart.clear();
  console.log(123);
  chart.render();
}, 2000);

额外信息

  • G2 5.0.15 版本
@antvis antvis locked and limited conversation to collaborators Jul 12, 2023
@pearmini pearmini converted this issue into discussion #5300 Jul 12, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant