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

// 注意由于分类轴的顺序是从下往上的，所以数组的数值顺序要从小到大
const data = [
  { country: '巴西', population: 18203 },
  { country: '印尼', population: 23489 },
  { country: '美国', population: 29034 },
  { country: '印度', population: 104970 },
  { country: '中国', population: 131744 },
];

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

chart.data(data);

chart.axis('country', {
  label: {
    offset: 12,
  },
});

chart.coordinate().transpose();
chart.interval().position('country*population');

chart.render();

@@ -32,43 +32,8 @@
 ';%0A%0A
-// %E6%B3%A8%E6%84%8F%E7%94%B1%E4%BA%8E%E5%88%86%E7%B1%BB%E8%BD%B4%E7%9A%84%E9%A1%BA%E5%BA%8F%E6%98%AF%E4%BB%8E%E4%B8%8B%E5%BE%80%E4%B8%8A%E7%9A%84%EF%BC%8C%E6%89%80%E4%BB%A5%E6%95%B0%E7%BB%84%E7%9A%84%E6%95%B0%E5%80%BC%E9%A1%BA%E5%BA%8F%E8%A6%81%E4%BB%8E%E5%B0%8F%E5%88%B0%E5%A4%A7%0A
 cons
@@ -305,25 +305,8 @@
 r',%0A
-  autoFit: true,%0A
   he
@@ -344,69 +344,8 @@
 );%0A%0A
-chart.axis('country', %7B%0A  label: %7B%0A    offset: 12,%0A  %7D,%0A%7D);%0A%0A
 char

add basic bar