How to use the @antv/g2plot.StackColumn 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 / column / stack / demo / label-auto-hide.js View on Github external
value: 10,
    type: 'Wiz',
  },
  {
    year: '1998',
    value: 12,
    type: 'Wiz',
  },
  {
    year: '1999',
    value: 3,
    type: 'Wiz',
  },
];

const columnPlot = new StackColumn(document.getElementById('container'), {
  forceFit: true,
  title: {
    visible: true,
    text: '堆叠柱状图:label自动隐藏',
  },
  description: {
    visible: true,
    text:
      '在堆叠柱状图中,如果label的位置被设定为middle,即显示在柱形中间。在对应柱形大小不够摆放label的情况下,label会被自动隐藏。',
  },
  data,
  xField: 'year',
  yField: 'value',
  yAxis: {
    min: 0,
  },
github antvis / G2Plot / examples / column / stack / demo / connected-area.js View on Github external
{ year: '2011', type: 'pears', value: 3 },
  { year: '2012', type: 'redDeliciou', value: 4 },
  { year: '2012', type: 'mcintosh', value: 15 },
  { year: '2012', type: 'oranges', value: 8 },
  { year: '2012', type: 'pears', value: 1 },
  { year: '2013', type: 'redDeliciou', value: 6 },
  { year: '2013', type: 'mcintosh', value: 11 },
  { year: '2013', type: 'oranges', value: 9 },
  { year: '2013', type: 'pears', value: 4 },
  { year: '2014', type: 'redDeliciou', value: 10 },
  { year: '2014', type: 'mcintosh', value: 13 },
  { year: '2014', type: 'oranges', value: 9 },
  { year: '2014', type: 'pears', value: 5 },
];

const columnPlot = new StackColumn(document.getElementById('container'), {
  forceFit: true,
  title: {
    visible: true,
    text: '区域联通组件',
  },
  description: {
    visible: true,
    text: '联通区域组件通过绘制同一字段的联通区域提供视觉上的辅助识别,方便进行数据对比。',
  },
  padding: 'auto',
  data,
  xField: 'year',
  yField: 'value',
  yAxis: {
    min: 0,
  },
github antvis / G2Plot / examples / column / stack / demo / connected-area-style.js View on Github external
{ year: '2011', type: 'pears', value: 3 },
  { year: '2012', type: 'redDeliciou', value: 4 },
  { year: '2012', type: 'mcintosh', value: 15 },
  { year: '2012', type: 'oranges', value: 8 },
  { year: '2012', type: 'pears', value: 1 },
  { year: '2013', type: 'redDeliciou', value: 6 },
  { year: '2013', type: 'mcintosh', value: 11 },
  { year: '2013', type: 'oranges', value: 9 },
  { year: '2013', type: 'pears', value: 4 },
  { year: '2014', type: 'redDeliciou', value: 10 },
  { year: '2014', type: 'mcintosh', value: 13 },
  { year: '2014', type: 'oranges', value: 9 },
  { year: '2014', type: 'pears', value: 5 },
];

const columnPlot = new StackColumn(document.getElementById('container'), {
  forceFit: true,
  title: {
    visible: true,
    text: '配置联通区域组件样式',
  },
  padding: 'auto',
  data,
  xField: 'year',
  yField: 'value',
  stackField: 'type',
  yAxis: {
    min: 0,
  },
  label: {
    visible: false,
  },