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 displays the time series properly spaced out. The issue is that it draws lines between the points directly without going to 0 for the missing data.
We are therefore happy to present to you our official Highcharts Angular wrapper, which is free to use (please note that using Highcharts for commercial projects require a valid license).
The point objects are generated from the series. data configuration objects or raw numbers. They can be accessed from the Series. points array. Other ways to instantiate points are through Highcharts.
The application can be used either as a CLI (Command Line Interface), as an HTTP server, or as a node.
One way is by pre-processing the data, replacing null
with 0
:
var withNulls = [null, 12, 23, 45, 3.44, null, 0]; var noNulls = withNulls.map(function (item) { return (item === null) ? 0 : item; });
Example saved on jsfiddle: http://jsfiddle.net/7mhMP/
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?
I feel this is a good representation of your data, because defaulting null
to 0
seems misleading.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With