highcharts 直方图中关于 bin 数量的错误

bug in highcharts histogram regarding number of bins

highcharts histogram number of bins 仅适用于使用 baseSeries 的变通方法,不适用于直接数据,有什么建议吗?

var data = [3.5, 3, 3.2, 3.1, 3.6, 3.9, 3.4, 3.4, 2.9, 3.1, 3.7, 3]
Highcharts.chart('container', {
    title: {
        text: 'Highcharts Histogram'
    },
    legend: {
        enabled: false
    },
    series: [{
        name: 'Histogram',
        type: 'histogram',
        baseSeries: 's1',
        // data: data,
        binsNumber: 10
    }, {
        name: 'Data',
        type: 'scatter',
        data: data,
        id: 's1',
        visible: false
    }]
});

好:

https://jsfiddle.net/erez_ahar/u0mebqzg/10/

不好:

https://jsfiddle.net/erez_ahar/u0mebqzg/11/

这不是错误。正如您在文档中所见:

The histogram series is a column series with no padding between the columns and with self-setting data. Unlike most other Highcharts series, the data property is not available - it is set internally based on the base series data (more precisely y values of the data).

有关直方图的更多信息 - documentation

所以一切正常。