How to use the @antv/g2plot.GroupBar function in @antv/g2plot

To help you get started, we’ve selected a few @antv/g2plot examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github antvis / G2Plot / examples / bar / group / demo / basic.js View on Github external
type: 'series2',
    value: 390,
  },
  {
    label: 'Fri.',
    type: 'series1',
    value: 170,
  },
  {
    label: 'Fri.',
    type: 'series2',
    value: 100,
  },
];

const barPlot = new GroupBar(document.getElementById('container'), {
  title: {
    visible: true,
    text: '分组条形图',
  },
  data,
  xField: 'value',
  yField: 'label',
  groupField: 'type',
  label: {
    formatter: (v) => `${v}`.replace(/\d{1,3}(?=(\d{3})+$)/g, (s) => `${s},`),
  },
});

barPlot.render();