首页 > 解决方案 > highcharts 系列类型“标志”不显示系列外的点

问题描述

我使用了 highcharts 系列类型“标志”并有一些数据点。当我的数据点列表来自例如 [-100;100] 但某些标志值超出此范围时,我遇到了这种情况。我找不到任何解决方案来显示这些超出范围的标志。

标签: javascripthighcharts

解决方案


该标志不在line系列上,因为 x 值超出范围:

series: [{
    id: "data",
    data: [
        [1569269259533, 100],
        [1569269319534, 100]
    ]
}, {
    type: 'flags',
    useHTML: true,
    y: -18,
    id: 'flags',
    onSeries: 'data'
}],
chart: {
    events: {
        load: function(e) {
            var flagSerie = this.get('flags');
            flagSerie.setData([{
                x: 1569269299533,
                count: 3
            }]);
        }
    }
}

现场演示:http: //jsfiddle.net/BlackLabel/rmonx6Lz/

API 参考: https ://api.highcharts.com/highstock/series.flags.onSeries


推荐阅读