ZoomCharts Documentation

Version: 1.21.1 (2024-11-08)
Switch to Version 2.0 (BETA)

ZoomCharts.GeoChart

Inheritance hierarchy

This type inherits from BaseApi.

Constructors

.ctor: (settings: GeoChartSettings)
Parameters
Return value
Data type: GeoChart

Methods

addData: (data: GeoChartDataObject, sourceId?: string): void
Inherited from: BaseApi

Adds the given data to whatever data the chart has currently loaded. The chart will automatically be updated to display this new data if it falls within the currently visible bounds.

Parameters
sourceId: string

the ID of the data source that will be updated. The default value is default.

addSubchartContainer: (container: HTMLElement): void
Inherited from: BaseApi
This property is deprected; use settings.parentChart instead.
Parameters
container: string | HTMLElement
back: (): this
Inherited from: BaseApi
Return value
Data type: this
bounds: (bounds?: IGeoRectangle): IGeoRectangle
Parameters
Return value
Data type: IGeoRectangle
clearHistory: (): this
Inherited from: BaseApi
Return value
Data type: this
customize: (name: string): this
Inherited from: BaseApi

Applies one of the built-in themes to the chart. This is an alternative to calling updateSettings({ theme: ZoomCharts.GeoChart.themes.dark }).

Parameters
name: string

The name of the theme to be applied, must be one of the values defined in the GeoChart.themes static property.

Return value
Data type: this
export: (type: "png" | "jpg" | "pdf" | "csv" | "xlsx", dimensions?: BaseExportDimensions, transparent?: boolean, fileName?: string): void
Inherited from: BaseApi

Launches a file download that contains an image or the data of the current state of the chart.

Note that in some browsers calling this method will send the data to a proxy. When handling sensitive data you should install the proxy on your own server, see advanced.exportProxyURL setting.

Parameters
type: "png" | "jpg" | "pdf" | "csv" | "xlsx"

The format in which the data will be exported.

Specifies the dimensions for the image formats.

transparent: boolean
Version 1.12.0: default changed to false.

Specifies if the resulting image should have transparent background. This setting is only valid for png image format. Default is false.

Note that if area.style.fillColor is set, this will have no effect.

fileName: string

Specifies the fileName to be used, excluding fileExtension

exportAsString: (type: "png" | "jpg" | "pdf" | "csv" | "xlsx", callback: (dataUri: string, mimeType: string, extension: string) => void, dimensions?: BaseExportDimensions, transparent?: boolean): void
Inherited from: BaseApi

Saves the current chart state as a data-URI.

If image type is specified, the URI can be used as the image source in <img src="">.

Note that some output settings might require sending the data to a proxy. When handling sensitive data you should install the proxy on your own server, see advanced.exportProxyURL setting.

Parameters
type: "png" | "jpg" | "pdf" | "csv" | "xlsx"

The format in which the data will be exported.

callback: (dataUri: string, mimeType: string, extension: string) => void

The callback that will be invoked once the result is generated.

Parameters
dataUri: string

The data-uri that contains the generated image or data file.

mimeType: string

The mime type of the generated file.

extension: string

The extension of the generated file.

Specifies the dimensions for the image formats.

transparent: boolean

Specifies if the resulting image should have transparent background. This setting is only valid for png image format. Default is false.

Note that if area.style.fillColor is set, this will have no effect.

exportGetDimensions: (dimensions: BaseExportDimensions): { width: number; height: number; scale: number; chartWidth: number; chartHeight: number; }
Inherited from: BaseApi
This property is deprected; use `exportImageGetDimensions` instead

Returns the dimensions for the image exported with exportImageAsString.

Parameters
Return value
Data type: anonymous type
Properties
width: number
height: number
scale: number
chartWidth: number
chartHeight: number
exportImageAsString: (type: "png" | "jpg" | "pdf" | "csv" | "xlsx", dimensions: BaseExportDimensions, transparent: boolean): string
Inherited from: BaseApi
This property is deprected; use `exportAsString` instead.

Saves the current chart state as an image.

Note that this method does not support custom DPI setting, for that exportAsString method has to be used.

Parameters
type: "png" | "jpg" | "pdf" | "csv" | "xlsx"
transparent: boolean
Return value
Data type: string

A base64 encoded data-URI that contains the image data. This URI can be used as the image source in <img src="">.

exportImageGetDimensions: (dimensions: BaseExportDimensions): { width: number; height: number; scale: number; chartWidth: number; chartHeight: number; }
Inherited from: BaseApi

Returns the dimensions for the image exported with exportImageAsString.

Parameters
Return value
Data type: anonymous type
Properties
width: number
height: number
scale: number
chartWidth: number
chartHeight: number
fullscreen: (isFullscreen?: boolean): boolean
Inherited from: BaseApi

Gets or sets the fullscreen state of the chart.

Parameters
isFullscreen: boolean

specify true or false to set the state, omit the value to get the current state.

Return value
Data type: boolean
getNode: (id: string): ItemsChartNode
Parameters
id: string
Return value
Data type: ItemsChartNode
getNodeDimensions: (node: string | ItemsChartNode): { x: number; y: number; radius: number; hwidth: number; }
Parameters
Return value
Data type: anonymous type
Properties
radius: number
hwidth: number
hideMenu: (): this
Return value
Data type: this
home: (): boolean
Inherited from: BaseApi
Return value
Data type: boolean
leaflet: (): any
Experimental property - the API might not be stable and is subject to change.

Returns the Leaflet.Map object to enable any advanced customizations.

Please note that this method might return null if leaflet.js has not been loaded yet. If leaflet.js is not loaded synchronously in the page, it will be loaded on demand by GeoChart. In this case the map object will not be available until the load is finished.

To handle this scenario, subscribe to onChartUpdate event and verify if this method returns non-null value.

Return value
Data type: any
off: (name: string, listener: (event: BaseMouseEvent, args: BaseChartEventArguments) => void): boolean
Inherited from: BaseApi

Removes an event listener that was added by a call to on or by specifying it in settings. Note that the listener must be the exact same reference, which means that anonymous functions should not be used in call to on.

Parameters
name: string

the type of the event. Please see the documentation for on about valid values.

listener: (event: BaseMouseEvent, args: BaseChartEventArguments) => void
Parameters
Return value
Data type: boolean

true if the listener was removed, false if the listener was not previously registered.

on: (name: string, listener: (event: BaseMouseEvent, args: BaseChartEventArguments) => void): void
Inherited from: BaseApi

Adds event listener.

Parameters
name: string

The type of the event for which the listener will be added. See method overloads for valid values.

listener: (event: BaseMouseEvent, args: BaseChartEventArguments) => void

The callback function. It receives two arguments - the mouse event data and a separate object containing chart specific information.

Parameters
Overloads
on: (name: "chartUpdate", listener: (event: BaseMouseEvent, args: ItemsChartChartEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "chartUpdate"
on: (name: "click", listener: (event: BaseMouseEvent, args: ItemsChartChartClickEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "click"
on: (name: "doubleClick", listener: (event: BaseMouseEvent, args: ItemsChartChartClickEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "doubleClick"
on: (name: "error", listener: (event: BaseMouseEvent, args: BaseChartErrorEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "error"
listener: (event: BaseMouseEvent, args: BaseChartErrorEventArguments) => void
Parameters

An empty mouse event.

on: (name: "hoverChange", listener: (event: BaseMouseEvent, args: ItemsChartChartEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "hoverChange"
on: (name: "lassoChange", listener: (event: BaseMouseEvent, args: BaseChartLassoUpdatedEventArguments) => void): void
Parameters
name: "lassoChange"
on: (name: "pointerDown", listener: (event: BaseMouseEvent, args: BaseChartEventArguments) => void): void
Inherited from: BaseApi

Adds an event listener for pointer down event.

Parameters
name: "pointerDown"
listener: (event: BaseMouseEvent, args: BaseChartEventArguments) => void
Parameters
on: (name: "dataUpdated", listener: (event: BaseMouseEvent, args: BaseChartEventArguments) => void): void
Inherited from: BaseApi

Adds an event listener for pointer down event.

Parameters
name: "dataUpdated"
listener: (event: BaseMouseEvent, args: BaseChartEventArguments) => void
Parameters
on: (name: "positionChange", listener: (event: BaseMouseEvent, args: ItemsChartChartEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "positionChange"
on: (name: "rightClick", listener: (event: BaseMouseEvent, args: ItemsChartChartClickEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "rightClick"
on: (name: "selectionChange", listener: (event: BaseMouseEvent, args: ItemsChartChartEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "selectionChange"
on: (name: "settingsChange", listener: (event: BaseMouseEvent, args: BaseChartSettingsChangeEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "settingsChange"
on: (name: "tripleClick", listener: (event: BaseMouseEvent, args: ItemsChartChartClickEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "tripleClick"
paintNow: (force?: boolean): this
Inherited from: BaseApi

Does immediate repaint. Use to sync updates between multiple charts.

Parameters
force: boolean
Return value
Data type: this
profiler: (): BaseProfiler
Inherited from: BaseApi
Return value
Data type: BaseProfiler
reloadData: (sourceId?: string): void
Inherited from: BaseApi

Clears data cache and loads new data. The current view is preserved.

Parameters
sourceId: string
remove: (): void
Inherited from: BaseApi

Removes chart from DOM. This method is automatically called when you create a new chart within the same container element.

This method should always be called when the chart HTML element is removed as otherwise there might be additional resources such as event handlers remaining that will prevent the browser from properly releasing memory.

replaceData: (data: GeoChartDataObject, sourceId?: string): void
Inherited from: BaseApi

Replaces the data already in the data cache with the given values.

Parameters
sourceId: string

the ID of the data source that will be updated. The default value is default.

replaceSettings: (changes: GeoChartSettings): this
Inherited from: BaseApi
Introduced in version 1.10.0.

Updates the chart settings but instead of merging some settings that are arrays or dictionaries (such as data) these collections are replaced completely. For example, this allows removal of series or value axis within TimeChart.

Parameters
Return value
Data type: this
restoreState: (state: string, animate?: boolean): void
Inherited from: BaseApi
Parameters
state: string
animate: boolean
resumePaint: (): void
Inherited from: BaseApi
Experimental property - the API might not be stable and is subject to change.

Decrements the suspend counter that was set using suspendPaint() method.

This method also automatically schedules an async repaint.

saveAsImage: (type: "png" | "jpg" | "pdf" | "csv" | "xlsx", dimensions: BaseExportDimensions, transparent: boolean): string
Inherited from: BaseApi
This property is deprected; use `exportAsString` instead

Saves the current chart state as an image.

Parameters
type: "png" | "jpg" | "pdf" | "csv" | "xlsx"
transparent: boolean
Return value
Data type: string

A base64 encoded data-URI that contains the image data. This URI can be used as the image source in <img src="">.

saveState: (): string
Inherited from: BaseApi
Return value
Data type: string

Set/Get selected objects.

Parameters

array of objects identifiers to select. Do not pass this parameter if you don't want to change current selection.

Return value

currently selected objects.

suspendPaint: (): void
Inherited from: BaseApi
Experimental property - the API might not be stable and is subject to change.

Suspends the animation of the chart until resumePaint() is called.

This should be used when the chart element is hidden from the user to conserve browser resources.

Note that if suspendPaint() is called multiple time then resumePaint() has to be called the same number of times.

updateFilters: (): void
Inherited from: BaseApi

Re-evaluate data filters on next paint.

updateSettings: (changes: GeoChartSettings): this
Inherited from: BaseApi

Updates the chart settings. Only the settings that have to be changed should be passed. Note that some arrays and dictionaries (such as data) are merged by the ID values - if instead they should be replaced, use replaceSettings() method.

Parameters
Return value
Data type: this
updateSize: (): this
Inherited from: BaseApi

Call when the container size has been changed to update the chart.

Return value
Data type: this
updateStyle: (objects?: Array<string>): void
Inherited from: BaseApi

Updates (recalculates) the style for the whole chart or specific objects matching the given IDs.

Parameters
objects: Array<string>

A list of IDs for the objects which need their style recalculated

zoomLevel: (newZoom?: number): number
Parameters
newZoom: number
Return value
Data type: number

Static properties

Lists the predefined themes for the chart. These can be used within the settings objects or via the customize() method:

var chart = new ZoomCharts.GeoChart({ theme: ZoomCharts.GeoChart.themes.dark });
chart.updateSettings({ theme: ZoomChart.GeoChart.themes.dark });
chart.customize("dark");
Properties

Properties

typeName: string
Inherited from: BaseApi

Gets the name of the chart the JavaScript object references. For example 'PieChart' or 'TimeChart'. This field is read-only.

X