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

facetRect 设置 coordinate({ type: 'polar' }) 失效 #5220

Closed
pearmini opened this issue Jun 25, 2023 Discussed in #5219 · 0 comments · Fixed by #5228
Closed

facetRect 设置 coordinate({ type: 'polar' }) 失效 #5220

pearmini opened this issue Jun 25, 2023 Discussed in #5219 · 0 comments · Fixed by #5228
Assignees
Labels

Comments

@pearmini
Copy link
Member

Discussed in #5219

  • 版本:5.0.13
import { Chart } from '@antv/g2';

const data = [
  {
    type: '《山河圖》',
    value: 1,
    n: 64,
  },
  {
    type: '《山河圖》',
    value: 2,
    n: 37,
  },
  {
    type: '《山河圖》',
    value: 3,
    n: 29,
  },
  {
    type: '《歸途有風》',
    value: 1,
    n: 58,
  },
  {
    type: '《歸途有風》',
    value: 2,
    n: 38,
  },
  {
    type: '《歸途有風》',
    value: 3,
    n: 25,
  },
];
const chart = new Chart({
  container: 'container',
  autoFit: true,
  theme: 'classic',
});

const facetchart = chart.facetRect().data(data).encode('x', 'type');

facetchart
  .interval()
  .coordinate({ type: 'polar' }) //  这里设置 polar
  .encode('x', 'value')
  .encode('y', 'n')
  .encode('color', 'value')
  .axis('y', false);

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