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
data
array is expected to provide adate
property that is aDate
object. When gaps are discovered in the array, "filler" objects will be inserted with an appropratedate
value 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
queryData
would look like this: