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

G2 Radar chart using javascript - reverse plotting of values #4047

Closed
swtjeeva opened this issue Jul 21, 2022 · 1 comment
Closed

G2 Radar chart using javascript - reverse plotting of values #4047

swtjeeva opened this issue Jul 21, 2022 · 1 comment

Comments

@swtjeeva
Copy link

  • G2 Version: 4.1.42
  • Platform: windows / mac
  • Mini Showcase(like screenshots):
    image

Plotting values in reverse is not working in Antv G2 Radar chart.
I am trying to plot chart.scale as min:5, max:1 - so the values in the middle should be 5 and should reduce to 1 when scaling outside. But, trying this in antv g2 chart, the chart is not responding properly and taking random axis values irrespective of given values(only if min value is greater than max value).
Much appreciable, if anyone has any idea about this to share.!

Thanks!

@hustcc
Copy link
Member

hustcc commented Sep 13, 2022

Very special situation.

A solution for you, the labels whose from 1.0 to 5.0 are just only text labels.

  1. process the demo, (x) => 5 - x to reverse the data
  2. show yaxis label 1.0 with 5.0, and so on
chart.axis('score', {
  label: {
    formatter: (v) => 5 - v, // here
  }
});

@hustcc hustcc closed this as completed Sep 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants