Skip to content

可否实现轴逆序 #5370

Answered by pearmini
KuduroJS asked this question in Q&A
Discussion options

You must be logged in to vote
import { Chart } from '@antv/g2';

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

chart
  .interval()
  .data({
    type: 'fetch',
    value:
      'https://gw.alipayobjects.com/os/bmw-prod/fb9db6b7-23a5-4c23-bbef-c54a55fee580.csv',
  })
  .encode('x', 'letter')
  .encode('y', 'frequency')
  .scale('y', { range: [0, 1] }) // 👈
  .axis('y', { labelFormatter: '.0%' });

chart.render();

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by KuduroJS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #5369 on August 03, 2023 02:14.