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

雷达图的 line、area 在 smooth 的时候不重叠 #4386

Closed
hustcc opened this issue Dec 1, 2022 · 0 comments · Fixed by #4387
Closed

雷达图的 line、area 在 smooth 的时候不重叠 #4386

hustcc opened this issue Dec 1, 2022 · 0 comments · Fixed by #4387
Assignees
Labels
Milestone

Comments

@hustcc
Copy link
Member

hustcc commented Dec 1, 2022

Image

import { Chart } from '@antv/g2';

const chart = new Chart({
  container: 'container',
  height: 400,
});

chart.coordinate({ type: 'polar' });

chart
  .data([
    { item: 'Design', type: 'a', score: 70 },
    { item: 'Design', type: 'b', score: 30 },
    { item: 'Development', type: 'a', score: 60 },
    { item: 'Development', type: 'b', score: 70 },
    { item: 'Marketing', type: 'a', score: 50 },
    { item: 'Marketing', type: 'b', score: 60 },
    { item: 'Users', type: 'a', score: 40 },
    { item: 'Users', type: 'b', score: 50 },
    { item: 'Test', type: 'a', score: 60 },
    { item: 'Test', type: 'b', score: 70 },
    { item: 'Language', type: 'a', score: 70 },
    { item: 'Language', type: 'b', score: 50 },
    { item: 'Technology', type: 'a', score: 50 },
    { item: 'Technology', type: 'b', score: 40 },
    { item: 'Support', type: 'a', score: 30 },
    { item: 'Support', type: 'b', score: 40 },
    { item: 'Sales', type: 'a', score: 60 },
    { item: 'Sales', type: 'b', score: 40 },
    { item: 'UX', type: 'a', score: 50 },
    { item: 'UX', type: 'b', score: 60 },
  ])
  .scale('x', { padding: 0.5, align: 0 })
  .scale('y', { tickCount: 5 })
  .axis('x', { grid: true })
  .axis('y', { zIndex: 1, title: false });

chart
  .area()
  .encode('x', 'item')
  .encode('y', 'score')
  .encode('color', 'type')
  .encode('shape', 'smooth')
  .style('fillOpacity', 0.5);

chart
  .line()
  .encode('x', 'item')
  .encode('y', 'score')
  .encode('color', 'type')
  .encode('shape', 'smooth')
  .style('lineWidth', 2);

chart.render();
@hustcc hustcc self-assigned this Dec 1, 2022
@hustcc hustcc added the Bug label Dec 1, 2022
@hustcc hustcc added this to the 5.0.0-beta.2 milestone Dec 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Status: Done
Development

Successfully merging a pull request may close this issue.

1 participant