ZoomCharts Documentation

Version: 1.21.1 (2024-11-08)

FacetChart.settings.seriesDefault.data

This section is defined by the type FacetChartSettingsSeriesData.

Data manipulation settings used for default series.

Properties

aggregatedValueFunction: (value: number, time: number, units: string) => number
Default value: null

Prepare displaying value after data aggregation.

Parameters
value: number

aggregated value that is about to be displayed

time: number

time display unit time stamp in ms

units: string

display unit

Return value
Data type: number

the value to display.

aggregation: "sum" | "min" | "max" | "first" | "last" | "avg" | "percentile" | "count"
Default value: "sum"

Aggregation function to use. Used when data source does not provide data in needed display unit. Note that when avg is used, you should provide countIndex so that the calculation is correct even across multiple units.

  • "max-threshold" modes finds the largest value that is at least X% of the data range; otherwise finds the minimum. X% is set with the 'percentile' setting.
Valid values:
  • sum
  • min - threshold
  • max - threshold
  • first
  • last
  • avg
  • percentile
  • count - counts non-null values. If countIndex is specified, uses that number for each value, otherwise counts each value as 1.
aggregationFunction: (displayUnit: string, fromTime: number, toTime: number, intervalValues: Array<number>, intervalCounts: Array<number>) => [number, number]
Default value: null

When given, then "aggregationFunction" is called to generate the value of each displayed data point instead of the fixed function specified by "aggregation".

Parameters
displayUnit: string

Unit to aggregate to

fromTime: number

Initial time for current data item

toTime: number

Final time for current data item

intervalValues: Array<number>

All data values in the time range

intervalCounts: Array<number>

All data counts in the time range

Return value
Data type: [number, number]

Array of two elements: The aggregated value, and the aggregated count, respectively

alwaysZeroMode: boolean
Default value: false

If true, zero mode sets every null to zero regardless of data range. If false, zero mode only sets nulls within the data range to zero

field: string
Default value: null

Object property of subvalue that will be used for series data aggregation. An alternative is to use valueFunction. If neither are specified the field value is implied.

noDataPolicy: "join" | "skip" | "zero"
Default value: "join"

Method used to fill in time intervals that have no data. Used only for line series.

Valid values:
  • join - links data points with straight line
  • skip - do not draw in this interval.
  • zero - draw as the value is zero.
percentile: number
Default value: 0.5

Controls the percentile level for percentile and threshold aggregation modes.

source: string
Default value: "default"

Data source to use if multiple data sources are available.

valueFunction: (data: Array<number> | FacetChartDataObject) => number
Default value: null

Retrieves the individual value used for calculations from the data array. This is an alternative for specifying index.

Parameters

entry in data values array where the value at index 0 is the timestamp

Return value
Data type: number

value to pass to aggregation

X