Skip to content

Instantly share code, notes, and snippets.

@kristw
Last active September 10, 2020 19:38
Show Gist options
  • Save kristw/a1148c8fffa24bbbeadc40663d0d0e24 to your computer and use it in GitHub Desktop.
Save kristw/a1148c8fffa24bbbeadc40663d0d0e24 to your computer and use it in GitHub Desktop.
import { Chart } from '@antv/g2';
const data = [
{country: "China", population: 131744},
{country: "India", population: 104970},
{country: "US", population: 29034},
];
const chart = new Chart({ container: 'container', autoFit: true, height: 500 });
chart.data(data);
chart.coordinate().transpose();
chart.scale('population', { nice: true });
chart.interval().position('country*population');
chart.render();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment