ZoomCharts Documentation

ZoomCharts.FacetChart

Inheritance hierarchy

This type inherits from BaseApi.

Constructors

.ctor: (settings: FacetChartSettings)
Parameters
Return value
Data type: FacetChart

Methods

addData: (data: FacetChartDataObjectRoot, 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
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.FacetChart.themes.dark }).

Parameters
name: string

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

Return value
Data type: this
expandSlice: (slice: FacetChartItem): boolean
Parameters
Return value
Data type: boolean
export: (type: "png" | "jpg" | "pdf" | "csv" | "xlsx", dimensions?: BaseExportDimensions, transparent?: boolean): 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.

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
getActiveFacet: (): FacetChartFacet
Return value
Data type: FacetChartFacet
getActiveFacets: (): Array<FacetChartFacet>
Return value
getActiveItems: (): Array<FacetChartItem>
Return value
Data type: Array<FacetChartItem>
getEnabledSeries: (): Array<FacetChartSettingsSeries>
Introduced in version 1.14.0.

Gets the currently enabled series

Return value
getPie: (): Array<string>
Return value
Data type: Array<string>
getPieOffset: (): number
Return value
Data type: number
Introduced in version 1.18.2.

Gets all series even those that are not enabled

Return value
home: (): boolean
Inherited from: BaseApi
Return value
Data type: boolean
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: "animationDone", listener: (event: BaseMouseEvent, args: FacetChartChartEventArguments) => void): void

Adds an event listener for when the scroll animation completes.

Parameters
name: "animationDone"
on: (name: "chartUpdate", listener: (event: BaseMouseEvent, args: FacetChartChartEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "chartUpdate"
on: (name: "click", listener: (event: BaseMouseEvent, args: FacetChartChartClickEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "click"
on: (name: "doubleClick", listener: (event: BaseMouseEvent, args: FacetChartChartClickEventArguments) => 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: FacetChartChartEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "hoverChange"
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: FacetChartChartEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "positionChange"
on: (name: "rightClick", listener: (event: BaseMouseEvent, args: FacetChartChartClickEventArguments) => void): void
Inherited from: BaseApi
Parameters
name: "rightClick"
on: (name: "selectionChange", listener: (event: BaseMouseEvent, args: FacetChartChartEventArguments) => 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: FacetChartChartClickEventArguments) => 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: FacetChartDataObjectRoot, 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.

replaceSeries: (series: Array<FacetChartSettingsSeries>): this
Use `replaceSettings({series: seriesData})` instead.

Replaces the existing series configuration with new one instead of merging it like updateSettings.

Parameters
Return value
Data type: this
replaceSettings: (changes: FacetChartSettings): 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
selection: (selected?: Array<string | FacetChartItem>): Array<FacetChartItem>
Parameters
Return value
Data type: Array<FacetChartItem>
setPie: (pieId: string | Array<string>, offset?: number, count?: number): this
Parameters
pieId: string | Array<string>
offset: number
count: number
Return value
Data type: this
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.

updateFilter: (): this
Return value
Data type: this
updateFilters: (): void
Inherited from: BaseApi

Re-evaluate data filters on next paint.

updateSettings: (changes: FacetChartSettings): 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: (): void
Inherited from: BaseApi

Re-evaluate style for all objects on next paint.

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.FacetChart({ theme: ZoomCharts.FacetChart.themes.dark });
chart.updateSettings({ theme: ZoomChart.FacetChart.themes.dark });
chart.customize("dark");
Properties
Introduced in version 1.8.0.

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