How to use the @antv/g2plot.Histogram 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 / histogram / demo / histogram-binNumber.js View on Github external
{ value: 15 },
  { value: 15.2 },
  { value: 15.6 },
  { value: 16.0 },
  { value: 16.3 },
  { value: 17.3 },
  { value: 17.5 },
  { value: 17.9 },
  { value: 18.0 },
  { value: 18.0 },
  { value: 20.6 },
  { value: 21 },
  { value: 23.4 },
];

const histogramPlot = new Histogram(document.getElementById('container'), {
  title: {
    visible: true,
    text: '直方图',
  },
  description: {
    visible: true,
    text: '通过设置binNumber进行分箱,binNumber决定直方图分箱的区域。',
  },
  forceFit: true,
  data,
  padding: 'auto',
  data,
  binField: 'value',
  binNumber: 6,
});
histogramPlot.render();
github antvis / G2Plot / examples / column / histogram / demo / histogram-binWidth.js View on Github external
{ value: 15 },
  { value: 15.2 },
  { value: 15.6 },
  { value: 16.0 },
  { value: 16.3 },
  { value: 17.3 },
  { value: 17.5 },
  { value: 17.9 },
  { value: 18.0 },
  { value: 18.0 },
  { value: 20.6 },
  { value: 21 },
  { value: 23.4 },
];

const histogramPlot = new Histogram(document.getElementById('container'), {
  title: {
    visible: true,
    text: '直方图',
  },
  description: {
    visible: true,
    text: '通过设置binWidth进行分箱,binWidth决定直方图分箱的数量。',
  },
  forceFit: true,
  data,
  padding: 'auto',
  data,
  binField: 'value',
  binWidth: 2,
});
histogramPlot.render();