Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
{ 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();
{ 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();