ZoomCharts Documentation

Version: 1.21.1 (2024-11-08)

TimeChart.settings.data

This section is defined by the type TimeChartSettingsData.

Properties

allowUnitCacheMultiples: boolean
Default value: false

Specifies if the cached values from a multiple of a unit may be used when retreiving the data for a larger unit. For example, whether data for "M" be used for "3 M"

This does nothing when useSmallerUnitCache is true, since that setting allows all smaller units to be used regardless of whether they are multiples.

When useSmallerUnitCache is false, this specifies whether that applies to all base units and multiples of base unitsor just for all base units

cacheSize: number
Default value: 500000
Version 1.14.0: default changed to 500000; the value will be automatically increased if the chart requires more entries at once to display the data.

Maximum number of data entries to store per data unit.

dataFunction: (from: number, to: number, unit: string, success: (data: TimeChartDataObject) => void, fail: (result: BaseDataErrorResponse) => void, timeZone: string) => void
Default value: null

A delegate that will be Load more chart data.

Parameters
from: number

UTC timestamp for the start of the time range for which data is required

to: number

UTC timestamp for the end of the time range for which data is required

unit: string
Version 1.15.0: units like 5 m are now also supported, if specified in the data.units array.

The unit by which the data has to be aggregated. The data source can also return smaller units.

success: (data: TimeChartDataObject) => void
Version 1.12.0: the value has to be an object, JSON strings are no longer accepted.

Callback function to execute when data arrived correctly.

Parameters
fail: (result: BaseDataErrorResponse) => void
Version 1.12.0: the value has to be an object, JSON strings are no longer accepted.

Callback function to execute when error occure while loading data.

Parameters
timeZone: string
Introduced in version 1.12.0.

The current display timezone for the chart. Only specified if the unit is days or larger, null otherwise.

format: "JSON" | "GeoJSON"
Default value: "JSON"
Inherited from: BaseSettingsData

Data loading format. Currently most charts only support JSON.

id: string
Default value: "default"
Inherited from: BaseSettingsData

Data id used for series to reference specific data source.

minimizeRequests: boolean
Default value: false
Version 1.15.0: the setting also has effect during animations and not only during user interaction.

Whether to request only when scrolling/scaling has stopped.

numberOfParallelRequests: number
Default value: 3
Inherited from: BaseSettingsData

Max number of parallel data requests to issue. More requests will result in faster loading, but might put heavy load on server.

postprocessorFunction: (data: string) => string
Default value: null
Inherited from: BaseSettingsData

Delegate that can be used to process data returned by the server for the HTTP request issued by the chart.

Parameters
data: string

The raw data received from the server.

Return value
Data type: string

The data object that will be further processed by the chart.

prefetchRatio: number
Default value: 1

How much data to load in advance. For example, if prefetchRatio=1, the chart will automatically load data so that the user can scroll a whole width of the chart to both sides without waiting for the data.

Inherited from: BaseSettingsData
Version 1.12.0: the value has to be an object, JSON strings are no longer accepted.

This property allows the data to be specified inline with the settings. Note that even if this is specified the chart might want to invoke url or dataFunction if the user selects a time range outside of what has been preloaded.

requestMaxUnits: number
Default value: 10000

Maximum number of data points to request in one go. Multiple requests will be issued if more data is needed.

Note that the server can opt to return less data in the response as well - more requests will be issued in this case as well.

requestTimeout: number
Default value: 40000
Inherited from: BaseSettingsData

Timeout in milliseconds for data requests. This timeout only applies to HTTP requests issued by the chart directly.

stringTimestampFormat: string | Array<string>
Introduced in version 1.12.0.

The format string (or strings) that is used to parse timestamps that are given as strings. Note that for optimal performance a single format string should be used (or even better, the numeric timestamps should be used instead).

When stringTimestampFormat is not specified the parser supports ISO 8601 formats (for details see moment documentation).

See moment documentation for details on the format strings.

suppressWarnings: boolean
Default value: false
Experimental property - the API might not be stable and is subject to change.

If set to true, the validation of the loaded data is not performed and warnings will not be displayed. Note that errors are not suppressed.

This setting should only be used when it is determined that the potential issues described by these warnings does not prevent the chart from working correctly. It should also be noted that a future version of the library might change the behavior of the situations the warnings are intended to prevent.

timeZoneOffset: string | number
Default value: null
deprecated
Version 1.12.0: the property has been deprecated in favor of timeZone in the data response.

Data time zone offset in minutes.

timestampInSeconds: boolean
Default value: false

Specifies whether the numeric timestamps used with this data source are in seconds instead of milliseconds.

This applies to the from and to request parameters and all timestamps within the data response.

units: Array<string>
Version 1.15.0: multiples of units can now also be specified (for example, 5 m).

Time steps at what data can be fetched.

url: string
Default value: null
Inherited from: BaseSettingsData

URL that is used to load data. Additional query string parameters are added to the given url: from, to, unit and timeZone. See the documentation of dataFunction for the description of these parameters.

urlByUnit: Dictionary<string>

Allows specifying specific URL for each time unit. This can be useful if the data is pregenerated in static files, for example, to specify different data file where time aggregated by months or years - urlByUnit: { 'y': '/data/yearData.json', 'm': '/data/monthData.json' }. If this is specified, it overrides url property.

urlParameters: Array<{ name?: string; value?: string; }>
Inherited from: BaseSettingsData

List of extra parameters to pass with data URL.

Properties
name: string

Parameter name.

value: string

Parameter value.

useSmallerUnitCache: boolean
Default value: true
Introduced in version 1.15.0.

Specifies if the cached values from a smaller unit may be used when retrieving the data for a larger unit.

This should be set to false when the data source uses a custom aggregation specific to each individual unit.

Note that currently the smaller units are only used when they overlap the required range completely. For partial overlap the values are only used as a placeholder while the larger unit is requested from the data source.

X