antvis/G2

不设置 color 通道,只设置 size 通道会报错 #5169

pearmini posted onGitHub

Discussed in https://github.com/antvis/G2/discussions/5158

  • 版本:5.0.11
import { Chart } from '@antv/g2';

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

chart
  .point()
  .data({
    type: 'fetch',
    value:
      'https://gw.alipayobjects.com/os/basement_prod/6b4aa721-b039-49b9-99d8-540b3f87d339.json',
  })
  .encode('x', 'height')
  .encode('y', 'weight')
  .encode('size', 'gender')

chart.render();

准确的说是无法单独设置离散的 size 通道,.encode('size', 'height') 是可以没有问题的。相关的 issue:https://github.com/antvis/G2/issues/5166

posted by pearmini almost 2 years ago

Fund this Issue

$0.00
Funded

Pull requests