Highstock数据分组问题:重叠系列

时间:2018-01-19 09:07:37

标签: highcharts highstock

最近我发现我的网页有Highstock休息。单击我已定义dataGrouping函数的范围选择器按钮时,分组前的系列仍显示在图表中。

img: the overlapping series

所以我回去找API reference。事实证明,API doc中给出的示例与我的问题相同:

the jsfiddle of the official example

$.getJSON('https://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=?', function (data) {
    // Create the chart
    Highcharts.stockChart('container', {

        chart: {
            height: 300
        },

        rangeSelector: {
            allButtonsEnabled: true,
            buttons: [{
                type: 'month',
                count: 3,
                text: 'Day',
                dataGrouping: {
                    forced: true,
                    units: [['day', [1]]]
                }
            }, {
                type: 'year',
                count: 1,
                text: 'Week',
                dataGrouping: {
                    forced: true,
                    units: [['week', [1]]]
                }
            }, {
                type: 'all',
                text: 'Month',
                dataGrouping: {
                    forced: true,
                    units: [['month', [1]]]
                }
            }],
            buttonTheme: {
                width: 60
            },
            selected: 2
        },

        title: {
            text: 'AAPL Stock Price'
        },

        subtitle: {
            text: 'Custom data grouping tied to range selector'
        },

        _navigator: {
            enabled: false
        },

        series: [{
            name: 'AAPL',
            data: data,
            marker: {
                enabled: null, // auto
                radius: 3,
                lineWidth: 1,
                lineColor: '#FFFFFF'
            },
            tooltip: {
                valueDecimals: 2
            }
        }]
    });
});

所以我想知道这是否是新更新的highstock.js代码的错误。

0 个答案:

没有答案