Normalize a data array of time series data based on an aggregate time step.
This method is useful for "filling in" gaps of data in situations where something expects
the data include placeholders for the gaps. Charting applications often expect this, for
example.
Each element in the data array is expected to provide a date property that is a Date
object. When gaps are discovered in the array, "filler" objects will be inserted with
an approprate date value and all other properties copied from the previous element but
set to null.
Here's an example where a new element is added to an array to fill in a missing time slot:
Normalize a data array of time series data based on an aggregate time step.
This method is useful for "filling in" gaps of data in situations where something expects the data include placeholders for the gaps. Charting applications often expect this, for example.
Each element in the
dataarray is expected to provide adateproperty that is aDateobject. When gaps are discovered in the array, "filler" objects will be inserted with an appropratedatevalue and all other properties copied from the previous element but set tonull.Here's an example where a new element is added to an array to fill in a missing time slot:
Then
queryDatawould look like this: