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

resize 的时候,右边的 legend 位置没有更新 #5302

Closed
pearmini opened this issue Jul 12, 2023 Discussed in #5301 · 0 comments · Fixed by #5304
Closed

resize 的时候,右边的 legend 位置没有更新 #5302

pearmini opened this issue Jul 12, 2023 Discussed in #5301 · 0 comments · Fixed by #5304
Assignees
Labels

Comments

@pearmini
Copy link
Member

Discussed in #5301

  • 问题:改变大小的时候 legend 的位置没有更新
  • 版本:5.0.15
import { Chart } from '@antv/g2';

const data = [
  { genre: 'Sports', sold: 275 },
  { genre: 'Strategy', sold: 115 },
  { genre: 'Action', sold: 120 },
  { genre: 'Shooter', sold: 350 },
  { genre: 'Other', sold: 150 },
];

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

chart
  .interval()
  .data(data)
  .encode('x', 'genre') 
  .encode('color', 'genre')
  .encode('y', 'sold')
  .legend('color', { position: 'right' });

chart.render();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant