How to use the @antv/g2plot.PercentageStackArea 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 / area / percentageArea / demo / basic.js View on Github external
year: '1950',
    value: 547,
  },
  {
    country: 'Europe',
    year: '1999',
    value: 729,
  },
  {
    country: 'Europe',
    year: '2050',
    value: 628,
  },
];

const areaPlot = new PercentageStackArea(document.getElementById('container'), {
  title: {
    visible: true,
    text: '百分比堆叠面积图',
  },
  data,
  meta: {
    year: {
      range: [0, 1],
    },
  },
  xField: 'year',
  yField: 'value',
  stackField: 'country',
});
areaPlot.render();