ZoomCharts Documentation

Version: 1.21.1 (2024-11-08)

PieChart.settings.data

This section is defined by the type PieChartSettingsData.

Properties

autoCategories: Array<string | ((obj: PieChartDataObject) => string)>

An array of fields for auto-categorization. For each field a new drilldown sub-level will be created, separated by the values of that field.

dataFunction: (id: string, limit: number, offset: number, success: (data: PieChartDataObjectRoot) => void, fail: (result: BaseDataErrorResponse) => void) => void
Default value: null

Load more chart data.

Parameters
id: string

The ID of the parent slice. null when loading the top level data.

limit: number

max number of slices to load on pie

offset: number

number of slices to skip from start

success: (data: PieChartDataObjectRoot) => void

callback function to execute when data arrived correctly

Parameters
fail: (result: BaseDataErrorResponse) => void

callback function to execute when error occure while loading data

Parameters
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.

itemsToLoad: number
Default value: 50

Number of slices to request from server.

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.

partialLoad: boolean
Default value: true

Enables/Disables partial load. Items will be loaded on demand but is not compatible with sortField or autoCategories.

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.

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

Provides the ability to embed chart data directly into the chart configuration.

This data can be complete or act as the initial data where the rest will be requested dynamically using url or dataFunction.

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.

Version 1.12.0: added the ability to specify ascending sort order.
Version 1.13.0: added the ability to specify multiple fields in an array.
Version 1.14.0: added the ability to specify a custom sort delegate.

If set, items will be sorted in descending order using values from this field. You can either specify a single field or an array of fields.

To sort the values ascending, prefix the field name with -, for example, -value (without any spaces).

The default value null means that the chart does not reorder the data and it is displayed in the order it is given in the data source.

The callback receives two data objects every iteration, return 0 for equal values, 1 if the first value should be before the other and -1 otherwise.

sortField: function (a, b) {
// handle null and undefined values as zeroes
var v1 = a.val || 0;
var v2 = b.val || 0;
if (v1 === v2) return 0;
if (v1 < v2) return 1;
return -1;
}
url: string
Default value: null
Inherited from: BaseSettingsData

URL that is used to load data

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.

X