G2 icon indicating copy to clipboard operation
G2 copied to clipboard

G2 Radar chart using javascript - reverse plotting of values

Open swtjeeva opened this issue 3 years ago • 0 comments

  • 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!

swtjeeva avatar Jul 21 '22 11:07 swtjeeva

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 avatar Sep 13 '22 02:09 hustcc