How to make highcharts default to 0 for missing data

后端 未结 4 2004
南笙
南笙 2020-12-14 05:56

I have a time series at a 1 minute interval. I would like to display that in a chart with missing points as 0.

I\'ve found xAxis.ordinal and turned that off which di

4条回答
  •  盖世英雄少女心
    2020-12-14 06:06

    I've thorougly searched the API reference of HighCharts, but they don't offer that option. What they do offer is the option to disable the connection of points when null data is in between (only line and area charts):

    var chart = new Highcharts.Chart({
        plotOptions: {
            line: {
                connectNulls: false
            }
        }
    });
    

    This is the default setting according to the API, so I'm not sure why your data does connect with null values in between. Maybe they have changed the defaults lately?

    Example of HighChart with missing data

    I feel this is a good representation of your data, because defaulting null to 0 seems misleading.

提交回复
热议问题