Skip to content
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

interval 和 line 有颜色编码的时候渲染失败 #5076

Closed
pearmini opened this issue May 23, 2023 · 1 comment
Closed

interval 和 line 有颜色编码的时候渲染失败 #5076

pearmini opened this issue May 23, 2023 · 1 comment
Assignees
Labels

Comments

@pearmini
Copy link
Member

pearmini commented May 23, 2023

  • 版本:5.0.8
  • 问题:和比例同步有关,但不一定是一个 bug,需要深入排查一下。
import { Chart } from '@antv/g2';

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

chart.data({
  type: 'fetch',
  value: 'https://assets.antv.antgroup.com/g2/movies.json',
});

chart
  .interval()
  .transform({ type: 'groupX', y: 'sum' })
  .axis('y', { labelFormatter: '~s' })
  .axis('x', { labelTransform: 'rotate(90)' })
  .encode('x', 'Major Genre')
  .encode('y', 'Worldwide Gross')
  .encode('color', () => 'Worldwide Gross')
  .tooltip({ channel: 'y', valueFormatter: '~s' });


chart
  .line()
  .transform({ type: 'groupX', y: 'sum' })
  .encode('x', 'Major Genre')
  .encode('y', 'US Gross')
  .encode('color', () => 'US Gross')
  .scale('series', { independent: true }) // 不加这一行无法正常渲染。
  .tooltip({ channel: 'y', valueFormatter: '~s' });

chart.render();
@pearmini pearmini changed the title interval 和 line interval 和 line 有颜色编码的时候渲染失败 May 23, 2023
@pearmini pearmini self-assigned this May 23, 2023
@pearmini pearmini added the V5 label May 23, 2023
@pearmini
Copy link
Member Author

pearmini commented Jul 3, 2023

相同的问题:#5250

@pearmini pearmini closed this as completed Jul 3, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant