Aggregated Bar Chart

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

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

chart.options({
  type: 'interval',
  data: {
    type: 'fetch',
    value: 'https://gw.alipayobjects.com/os/antvdemo/assets/data/diamond.json',
  },
  transform: [
    {
      type: 'groupX',
      y: 'max',
    },
  ],
  encode: { x: 'clarity', y: 'price', color: 'clarity' },
  axis: { y: { labelFormatter: '~s' } },
  tooltip: { items: [{ channel: 'y', valueFormatter: '~s' }] },
});

chart.render();
Site search
Documentation and examplesType to start searching

Search documentation, APIs, and examples

SelectOpenEscClose