Last updated

API / geotoolkit / charts / widgets / ChartWidget / ChartWidget

Class: ChartWidget

widgets.ChartWidget.ChartWidget

ChartWidget extends AnnotatedWidget and provides API for storing, showing and synchronizing different charts.

Example

import {Data} from '@int/geotoolkit/charts/Data';
import {ChartType} from '@int/geotoolkit/charts/ChartType';
import {ChartWidget} from '@int/geotoolkit/charts/widgets/ChartWidget';
import {AnnotationLocation} from '@int/geotoolkit/layout/AnnotationLocation'

const data = new Data({…});
const widget = new ChartWidget({
'data': data,
'axes': {
'xAxis-1': { // axis identifier, see geotoolkit/charts/Axis for options
'location': AnnotationLocation.South,
'min': 0,
'grid': {
'visible': false
}
},
'yAxis-1': {…}
}
});
// add charts based on the data provided (see :
widget.addChart({
'type': ChartType.LineChart,
// data series identifiers
'series': {
'x': 'data-series-1',
'y': 'data-series-2'
},
// connect to the axis:
'axes': {
'x': 'xAxis-1',
'y': 'yAxis-1'
}
});

Hierarchy

Table of contents

Constructors
Methods
addAxisaddBaseLayeraddChart
addChildaddCssClassaddInvalidateHandler
addLegendaddLegendInteraladdOverlay
addTitleadjustPositionapplyOpacity
applyResponsiveStylebeginExportcanSwapAxes
changeBaseLayerOrderchangeChartOrderchangeChildOrder
changeOverlayOrdercheckCollisionclear
clearBaseLayersclearCacheclearCharts
clearChildrenclearOverlaysclone
connectconnectStyleconnectTool
copyConstructordisconnectdisconnectStyle
disconnectTooldisposedrawBorder
enableClippingenableEventPropagationenablePickingChildren
endExportenumerateNodesexecute
exportToPdffilterfitToBounds
getAnimationStylegetAnnotationgetAnnotationSize
getAutoModelLimitsModegetAutoModelLimitsStrategygetAxis
getBaseLayergetBaseLayersgetBaseLayersCount
getBoundsgetCachegetCenterModelLimits
getChartgetChartsCountgetChild
getChildrengetChildrenCountgetClassName
getClipStylegetColorBargetColorbars
getContentOrientationgetContentsAreagetContentsTransform
getCssgetCssClassgetCssClasses
getCssTransformgetDatagetDataSource
getDesiredHeightgetDesiredWidthgetDeviceLimits
getExportElementgetExportLimitsgetExportScale
getExportStategetFillStylegetId
getInfiniteModegetInvalidateMethodgetLayout
getLayoutStylegetLegendgetLegendLayer
getLegendPanelgetLegendPanelsgetLegendVisible
getLegendsgetLineStylegetLocalTransform
getManipulatorLayergetMarginsStylegetModel
getModelLimitsgetNamegetOpacity
getOpacityBlendModegetOverlaygetOverlayAt
getOverlayLayergetOverlaysgetOverlaysCount
getPaddingStylegetParentgetPreferredSize
getPropertiesgetPropertygetPropertyKeys
getRenderingFiltergetResponsiveStylegetRoot
getScaleScrollStrategygetSceneTransformgetSelectionMode
getSelectionRadiusgetTaggetTitle
getToolgetToolByNamegetToolByType
getToolsOptionsgetVisiblegetVisibleCenterModelLimits
getVisibleDeviceLimitsgetVisibleModelLimitsgetWorldTransform
getZIndexhasCssClasshasEventListener
hitTestindexOfBaseLayerindexOfChart
indexOfChildindexOfOverlayinitializeFloatingAnnotationTool
initializeLayoutinitializeToolsinsertAxis
insertBaseLayerinsertChartinsertChild
insertOverlayinvalidateinvalidateLayout
invalidateParentinverseTransformisClippingEnabled
isDisposedisEventPropagationEnabledisHorizontalFlip
isLayoutInvalidatedisNotificationEnabledisPickingChildrenEnabled
isSelectableisSilentisVerticalFlip
listToolsNamesloadTemplatemoveTo
notifynotifyRootoff
ononBoundsChangedonChildAdded
onChildRemovedonParentChangedonVisibilityChanged
panpanModelTopostRendering
preRenderingrebuildrefreshLayout
registerAnimationStyleremoveAxisremoveBaseLayer
removeChartremoveChildremoveCssClass
removeInvalidateHandlerremoveLegendremoveOverlay
removeTitlerenderrenderAsync
renderBackgroundrenderBaseLayersrenderBaseLayersAsync
renderChildrenrenderChildrenAsyncrenderContent
renderContentAsyncrenderOverlaysrenderOverlaysAsync
restoreToolStateresumeUpdaterotate
saveTemplatesaveToolsStatescale
scaleModelsetAnimationStylesetAnnotationSize
setAnnotationsOptionssetAutoModelLimitsModesetAutoModelLimitsStrategy
setBoundssetCachesetCenterModelLimits
setChildsetClipStylesetContentOrientation
setCsssetCssClasssetCssTransform
setDataSourcesetDesiredHeightsetDesiredWidth
setExportLimitssetExportScalesetFillStyle
setHorizontalFlipsetIdsetInfiniteMode
setLayoutsetLayoutInvalidatedsetLayoutStyle
setLineStylesetLocalTransformsetMarginsStyle
setModelLimitssetModelTransformationsetName
setNotificationsetOpacitysetPaddingStyle
setPropertiessetPropertysetRenderingFilter
setResponsiveStylesetScaleScrollStrategysetSelectable
setSelectionModesetSilentsetTag
setTitlesetTitleOptionssetTool
setToolCustomModeEnabledsetToolsOptionssetVerticalFlip
setVisiblesetVisibleCenterModelLimitssetVisibleModelLimits
setZIndexshearsuspendUpdate
swapAxessynchronizeViewLimitstoString
tooltipTitleFormattransformtranslate
translateModelunregisterAnimationStyleupdateLayout
updateSceneTransformationupdateStateupdateSuspended
updateTimeStampzoomInzoomOut
zoomToRectenableSceneGraphNotificationfindParent
getClassNameisSceneGraphNotificationEnabled
Css Properties
Name Type Description
selectionmodeSelectionModeSelection mode for tooltip, selection and crosshair tools. It shows how to highlight charts and display tooltip
usedesiredoffsetbooleanUse getDesiredOffset from AbstractChart to calculate limits

Contents

Constructors

new ChartWidget(options)

new ChartWidget(options?)

ChartWidget extends AnnotatedWidget and provides API for storing, showing and synchronizing different charts

Parameters

Name Type Description
Optional optionsOptionswidget options

Overrides

AnnotatedWidget.constructor

Methods

addAxis

addAxis(axis, location, connectedObject?): Object

add new axis and connect with object

Parameters

Name Type Description
axisAxis | Optionsnew axis instance or options
locationAnnotationLocationlocation of annotation for adding new axis
Optional connectedObjectGroup<Node>connected object of axis

Returns

Object

NameType
axisAxis
groupGroup<Node>

Overrides

AnnotatedWidget.addAxis

addAxis(options, location, connectedObject?): Object

add new axis and connect with object

Parameters

Name Type Description
optionsPolarAxisOptionspolar axis options
locationPolarAnnotationLocationlocation of annotation for adding new axis
Optional connectedObjectGroup<Node>connected object of axis

Returns

Object

NameType
axisAxis
groupGroup<Node>

Overrides

AnnotatedWidget.addAxis


addBaseLayer

addBaseLayer(baseLayer): ChartWidget

Add baseLayer to container

Parameters

Name Type Description
baseLayerNode | Node[]baseLayer to be added

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.addBaseLayer


addChart

addChart(options): ChartWidget

Adds chart to the widget

Example

import {ChartType} from '@int/geotoolkit/charts/ChartType';

// setup data series:
widget.setDataSource([{
'id': 'Manufacturing',
'data': [1, 2, 3, ...]
}, {
'id': 'Sales &amp; Distribution',
'data': [10, 20, 30, ...]
}]);
...
widget.addChart({
'type': ChartType.LineChart,
'series': {
'y': 'Manufactoring'
}
});

Parameters

Name Type Description
optionsChartOptionschart options

Returns

ChartWidget

this


addChild

addChild(node): ChartWidget

Add a child node

Parameters

Name Type Description
nodeNode | Iterator<Node> | Node[]the child node to be added

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.addChild


addCssClass

addCssClass(cssclass): ChartWidget

Adds new css class to node

Parameters

Name Type Description
cssclassstring | string[]css class name('s)

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.addCssClass


addInvalidateHandler

addInvalidateHandler(handler): ChartWidget

Add invalidate handler

Deprecated

since 4.0, use Node.on instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.addInvalidateHandler


addLegend

addLegend(options): LegendPanel

Creates legend, scrollable panel and interactive tools for the options provided. If legend already exists, does nothing.

Example

widget.addLegend({
// use known types to create legend items automatically (from charts)
// use custom string item for user setup
'type': LegendType.Color3d,
'alignment': AnchorType.LeftTop,
'offset': new Point(60, 40)
});

Parameters

Name Type Description
optionsLegendOptions | LegendPanellegend options

Returns

LegendPanel

Overrides

AnnotatedWidget.addLegend


addLegendInteral

Protected addLegendInteral(options): LegendPanel

Parameters

Name Type
optionsLegendOptions | LegendPanel

Returns

LegendPanel

Inherited from

AnnotatedWidget.addLegendInteral


addOverlay

addOverlay(overlay): ChartWidget

Add overlay to container

Parameters

Name Type Description
overlayNode | Node[]overlay to be added

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.addOverlay


addTitle

addTitle(location, options): void

Add title to annotation

Parameters

Name Type Description
locationAnnotationLocationof the title
optionsTitleOptionstitle options

Returns

void

Inherited from

AnnotatedWidget.addTitle


adjustPosition

adjustPosition(area?, vAlign?, hAlign?): ChartWidget

Adjust position of node to specified area

Parameters

Name Type Description
Optional areaRectspecified area. Default to Parent Model Limits
Optional vAlignstringvertical alignment. It can be "top", "bottom", "center". Defaults to "top".
Optional hAlignstringhorizontal alignment It can be "left", "right", "center". Defaults to "left".

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.adjustPosition


applyOpacity

Protected applyOpacity(context): ChartWidget

This method is called to apply opacity if it is specified on the rendering context. The default implementation sets global alpha on the rendering context

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.applyOpacity


applyResponsiveStyle

Protected applyResponsiveStyle(): void

Apply a responsive style rules it is exists

Returns

void

Inherited from

AnnotatedWidget.applyResponsiveStyle


beginExport

beginExport(): ChartWidget

Prepares object before exporting and saving state

Returns

ChartWidget

Inherited from

AnnotatedWidget.beginExport


canSwapAxes

canSwapAxes(axis1, axis2): boolean

Check if swapping axes is doable.
Invalid swap cases are:
a) axis(-es) ID(s) is(are) not defined;
b) axis(-es) doesn't (don't) belong to the widget;
c) the pair of axes represent "x" and "y" dimensions, and one of the axes is shared between two or more charts in the widget while the other ones differ.

Parameters

Name Type Description
axis1Axisfirst axis
axis2Axissecond axis

Returns

boolean


changeBaseLayerOrder

changeBaseLayerOrder(overlay, order, anchor?): ChartWidget

Changes the z-order of the baseLayer.

Parameters

Name Type Description
overlayNode
orderNodeOrderposition to be added
Optional anchorNodeanchor node to specify changeOrder with respect to this node

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.changeBaseLayerOrder


changeChartOrder

changeChartOrder(chart, order, anchor?): ChartWidget

Changes order of the charts being rendered.

Parameters

Name Type Description
chartAbstractChartany chart added to the widget
orderNodeOrderposition to be added
Optional anchorAbstractChartanchor chart to specify changeOrder with respect to this chart

Returns

ChartWidget

this


changeChildOrder

changeChildOrder(node, order, anchor?): ChartWidget

changes the z-order of the nodes being rendered.

Parameters

Name Type Description
nodeNodeany child added in the Composite node
orderNodeOrderposition to be added
Optional anchorNodeanchor node to specify changeOrder with respect to this node

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.changeChildOrder


changeOverlayOrder

changeOverlayOrder(overlay, order, anchor?): ChartWidget

Changes the z-order of the overlay.

Parameters

Name Type Description
overlayNodechild overlay
orderNodeOrderposition to be added
Optional anchorNodeanchor node to specify changeOrder with respect to this node

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.changeOverlayOrder


checkCollision

checkCollision(context): boolean

Check culling Returns true if object is inside of renderable area

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

boolean

true if node is collided

Inherited from

AnnotatedWidget.checkCollision


clear

clear(): ChartWidget

Returns

ChartWidget


clearBaseLayers

clearBaseLayers(disposeBaseLayers?): ChartWidget

Remove all child baseLayers from group

Parameters

Name Type Description
Optional disposeBaseLayersbooleanautomatically dispose baseLayers. If it is true then method dispose is called for each baseLayer, false by default

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.clearBaseLayers


clearCache

clearCache(): ChartWidget

Clear cache

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.clearCache


clearCharts

clearCharts(): ChartWidget

Removes all charts

Returns

ChartWidget

this


clearChildren

clearChildren(disposeChildren?): ChartWidget

Remove all child nodes from this composite group

Parameters

Name Type Description
Optional disposeChildrenbooleanautomatically dispose children. If it is true then method dispose is called for each child.

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.clearChildren


clearOverlays

clearOverlays(disposeOverlays?): ChartWidget

Remove all child overlays from group

Parameters

Name Type Description
Optional disposeOverlaysbooleanautomatically dispose overlays. If it is true then method dispose is called for each overlay, false by default

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.clearOverlays


clone

clone(): Group<Node>

All subclasses should override copyConstructor or provide custom implementation for this method

Returns

Group<Node>

clone

Inherited from

AnnotatedWidget.clone


connect

connect(object, model, orientation?, autoSize?): ChartWidget

Synchronizes object with a model

Parameters

Name Type Description
objectAxis | Group<Node>object to be synchronized
modelGroup<Node> | AbstractChartsource model
Optional orientationOrientationhorizontal or vertical
Optional autoSizebooleantrue if object and model share the same device size in the orientation, true by default if not specified

Returns

ChartWidget

this

Overrides

AnnotatedWidget.connect


connectStyle

connectStyle(style, type, callback): ChartWidget

Connects style.

This convenience method subscribes a listener to given style for the specified type.
And automatically un-subscribes listener if node is disposed to prevent memory leaks

Parameters

Name Type Description
styleEventDispatcherconnect style
typestringtype of event or property
callbackAttributeCallback<EventDispatcher>function to be called

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.connectStyle


connectTool

connectTool(tool): ChartWidget

Connect a new tool with a toolname to the widget

Parameters

Name Type Description
toolAbstractTool | AbstractTool[]tool associated with the widget

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.connectTool


copyConstructor

Protected copyConstructor(src, deepCopy?): ChartWidget

Copy constructor function.
Function used as part of the cloning mechanism.
Implementations should copy the given instance state to this instance.

Parameters

Name Type Description
srcGroup<Node>Source to copy from
Optional deepCopybooleandeep copy

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.copyConstructor


disconnect

disconnect(object): ChartWidget

Disconnect an object from its source model

Parameters

Name Type Description
objectAxis | Group<Node>object to disconnect

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.disconnect


disconnectStyle

disconnectStyle(style, type, callback): ChartWidget

Disconnect style
This convenience method un-subscribes a listener to given style for the specified type.

Parameters

Name Type Description
styleEventDispatcherconnect style
typestringtype of event or property
callbackAttributeCallback<EventDispatcher>function to be called

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.disconnectStyle


disconnectTool

disconnectTool(tool): ChartWidget

Disconnect the tool from the widget

Parameters

Name Type Description
toolAbstractTool | AbstractTool[]tool to disconnect

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.disconnectTool


dispose

dispose(): void

Dispose node. Clear all listeners and disconnect style to avoid memory leaks

Returns

void

Inherited from

AnnotatedWidget.dispose


drawBorder

Protected drawBorder(localContext, bounds?): ChartWidget

Draws a rectangle at the bounding box (in parent coordinates)

Parameters

Name Type Description
localContextRenderingContextThe local rendering context
Optional boundsRectgroup bounds

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.drawBorder


enableClipping

enableClipping(doClip): ChartWidget

Enables or disables clipping of this node. If enabled, shapes will not be rendered outside of its bounds.

Parameters

Name Type Description
doClipbooleanenable clipping on this node

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.enableClipping


enableEventPropagation

enableEventPropagation(enable): ChartWidget

Enable event propagation from the node hierarchy from bottom to top

This option is similar to DOM Event bubbling, which allows to get any event from child node. By default it is disabled for better performance.

Example

import {Group} from '@int/geotoolkit/scene/Group';
import {Events as SceneEvents} from '@int/geotoolkit/scene/Node';
const parentGroup = new Group()
.setName('ParentGroup')
.enableEventPropagation(true);
const childGroup = new Group()
.setName('ChildGroup');

parentGroup.addChild(childGroup);
parentGroup.on(SceneEvents.Invalidate, (eventName, sender, args) => {
// Got notifications from all children of parent group
});
childGroup.invalidate();

Parameters

Name Type Description
enablebooleanenable

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.enableEventPropagation


enablePickingChildren

enablePickingChildren(enable): ChartWidget

Enables or disables picking children

Parameters

Name Type Description
enablebooleanenable picking children

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.enablePickingChildren


endExport

endExport(): void

Restores object's state after exporting

Returns

void

Inherited from

AnnotatedWidget.endExport


enumerateNodes

enumerateNodes(callback, target?): void

Executes a provided function once for each child node

Parameters

Name Type Description
callbackCallback<Node>provided function
Optional targetQueryBuilder<any>target to pass to callback as a second parameter

Returns

void

Inherited from

AnnotatedWidget.enumerateNodes


execute

execute(delegate): ChartWidget

Executes delegate and return the result. It allows us to keep all initialization calls in one place,
and we do not need to scroll up or down in IDE to find how and where it was initialized.

Example

// All setters (.setName() for example) returns reference to the this.
// In order to modify inner object like LineStyle or Pattern, to get this object (property) we should call getter to get object reference.
// Then modify it as shown below in Option 1 or you can use execute methods shown in Option 2.
import {Group} from '@int/geotoolkit/scene/Group';
import {Rect} from '@int/geotoolkit/util/Rect';
// Option 1
const group = new Group()
.setName('MyGroup')
.setBounds(new Rect(0, 0, 42, 16))
.enableClipping(true)
.setTag({'type': 'sometype'});

group.getLineStyle().setPattern('pattern');
return group;

// Options 2 ( using execute method )
return group
.execute(function () {
this.getLineStyle()
.setPattern("pattern");
});

Parameters

Name Type Description
delegate(this: ChartWidget) => voidFunction to execute

Returns

ChartWidget

The result if any or this

Inherited from

AnnotatedWidget.execute

execute<T>(delegate): T

Type parameters

Name
T

Parameters

Name Type
delegate(this: ChartWidget) => T

Returns

T

Inherited from

AnnotatedWidget.execute


exportToPdf

exportToPdf(options?): Promise<IWritable>

Export a part of the container to PDF

This method sets automatically export scale and limits based on input parameters and current model scale and limits

Parameters

Name Type Description
Optional optionsExportToPdfOptionsoption to specify paper parameters and header and footer

Returns

Promise<IWritable>

promise with output stream

Inherited from

AnnotatedWidget.exportToPdf


filter

Protected filter(context): boolean

Filter node

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

boolean

flag filter flag ("true" to render node; "false" otherwise)

Inherited from

AnnotatedWidget.filter


fitToBounds

fitToBounds(): ChartWidget

fit bounds to model limits

Fires

Events.ModelVisibleLimitsChanged

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.fitToBounds


getAnimationStyle

getAnimationStyle(): AnimationStyle

Return animation style

Returns

AnimationStyle

animationStyle current animation style

Inherited from

AnnotatedWidget.getAnimationStyle


getAnnotation

getAnnotation(location): Group<Node>

return the node at the specific annotation

Parameters

Name Type Description
locationAnnotationLocationposition to return the node for

Returns

Group<Node>

Inherited from

AnnotatedWidget.getAnnotation


getAnnotationSize

getAnnotationSize(): Required<AnnotationSize>

Return sizes of all annotations or the exact one

Returns

Required<AnnotationSize>

contains size of all annotations

Inherited from

AnnotatedWidget.getAnnotationSize

getAnnotationSize(loc): string | number

Parameters

Name Type
locAnnotationLocation

Returns

string | number

Inherited from

AnnotatedWidget.getAnnotationSize


getAutoModelLimitsMode

getAutoModelLimitsMode(): boolean

Get Model Limits Logics to use when no Model Limits have been set set to true: will use parents width and height, starting at 0 set to false: will use parents bounds

Returns

boolean

mode

Inherited from

AnnotatedWidget.getAutoModelLimitsMode


getAutoModelLimitsStrategy

getAutoModelLimitsStrategy(): ModelLimitsStrategy

Get Model Limits Logics Strategy

Returns

ModelLimitsStrategy

strategy

Inherited from

AnnotatedWidget.getAutoModelLimitsStrategy


getAxis

getAxis(): Record<string, Axis>

Returns

Record<string, Axis>

getAxis(id): Axis

Parameters

Name Type
idstring

Returns

Axis


getBaseLayer

getBaseLayer(index): Node

Return baseLayer at specified index

Parameters

Name Type Description
indexnumberindex at which to get the baseLayer for

Returns

Node

track

Inherited from

AnnotatedWidget.getBaseLayer


getBaseLayers

getBaseLayers<S>(predicate, modify?): Iterator<Node>

Return iterator by baseLayers nodes

Type parameters

NameType
Sextends Node<S>

Parameters

Name Type Description
predicate(value: Node) => value is Sa filter function
Optional modifybooleanAn option to specify if the iterator supports adding/removing items from the collection. false by default.

Returns

Iterator<Node>

Inherited from

AnnotatedWidget.getBaseLayers

getBaseLayers(filter?, modify?): Iterator<Node>

Returns an iterator for child baseLayers. The iterator does not support adding or deleting items from overlays by default. If it is necessary to modify a collection of overlays, pass true as the last parameter.

Example

// Gets a writable iterator
const it = node.getOverlays(null, true);

Parameters

Name Type Description
Optional filter(node: Node) => booleanA filter function. Returns all overlays if null.
Optional modifybooleanAn option to specify if the iterator supports adding/removing items from the collection. false by default.

Returns

Iterator<Node>

An iterator for child overlays.

Inherited from

AnnotatedWidget.getBaseLayers


getBaseLayersCount

getBaseLayersCount(): number

Returns amount of baseLayers

Returns

number

Inherited from

AnnotatedWidget.getBaseLayersCount


getBounds

getBounds(): Rect

Get the bounds in the parents model space. If bounds are not set, then parent model limits are used.

Returns

Rect

current bounds

Inherited from

AnnotatedWidget.getBounds


getCache

getCache(): Cache

Return cache strategy to be used to cache children nodes

Returns

Cache

cache

Inherited from

AnnotatedWidget.getCache


getCenterModelLimits

getCenterModelLimits(): Rect

Return model limits

Returns

Rect

annotated model limits

Inherited from

AnnotatedWidget.getCenterModelLimits


getChart

getChart(id): AbstractChart

Returns chart by index or its name

Parameters

Name Type Description
idstring | number | LegendItemindex of the chart (if number) or chart name (if string) or legend item (if LegendItem)

Returns

AbstractChart


getChartsCount

getChartsCount(): number

Returns total number of charts

Returns

number


getChild

getChild(i): Node

Return node by index

Parameters

Name Type Description
inumberindex of the node

Returns

Node

Inherited from

AnnotatedWidget.getChild


getChildren

getChildren<S>(predicate, modify?): Iterator<S>

Return iterator by child nodes

Type parameters

NameType
Sextends Node<S>

Parameters

Name Type Description
predicate(value: Node) => value is Sa filter function
Optional modifybooleanAn option to specify if the iterator supports adding/removing items from the collection. false by default.

Returns

Iterator<S>

Inherited from

AnnotatedWidget.getChildren

getChildren(filter?, modify?): Iterator<Node>

Returns an iterator for child nodes. The iterator does not support adding or deleting items from children by default. If it is necessary to modify a collection of children, pass true as the last parameter.

Example

// Gets a writable iterator
const it = node.getChildren(null, true);

Parameters

Name Type Description
Optional filter(node: Node) => booleanA filter function. Returns all nodes if null.
Optional modifybooleanAn option to specify if the iterator supports adding/removing items from the collection. false by default.

Returns

Iterator<Node>

An iterator for child nodes.

Inherited from

AnnotatedWidget.getChildren


getChildrenCount

getChildrenCount(): number

Return number of child nodes

Returns

number

Inherited from

AnnotatedWidget.getChildrenCount


getClassName

getClassName(): string

Returns

string

Inherited from

AnnotatedWidget.getClassName


getClipStyle

getClipStyle(): ClipStyle

Gets the current clipping style

Returns

ClipStyle

clipping style

Inherited from

AnnotatedWidget.getClipStyle


getColorBar

getColorBar(id): ColorBar

Returns color bar shape for the colorbar-typed axis, null if axis not found

Parameters

Name Type Description
idstring | numbercolor bar identifier

Returns

ColorBar


getColorbars

getColorbars(): Record<string | number, ColorBar>

Returns id => colorbar map object for current colorbar axes

Returns

Record<string | number, ColorBar>


getContentOrientation

getContentOrientation(): Orientation

Return content orientation

Returns

Orientation

content orientation

Inherited from

AnnotatedWidget.getContentOrientation


getContentsArea

getContentsArea(transformation?): Rect

Return area without paddings. Model limits are mapped to content area, where children are layout.

Parameters

Name Type Description
Optional transformationTransformationscene transformation

Returns

Rect

Inherited from

AnnotatedWidget.getContentsArea


getContentsTransform

getContentsTransform(): Transformation

getContentsTransform() retrieves the world transformation of the node.

Returns

Transformation

transformation from model coordinates to bounds of the group

Inherited from

AnnotatedWidget.getContentsTransform


getCss

getCss(): CssStyle

Return CSS style

Returns

CssStyle

Inherited from

AnnotatedWidget.getCss


getCssClass

getCssClass(): string

Returns css class name to be used to apply CSS style

Returns

string

the css class name

Inherited from

AnnotatedWidget.getCssClass


getCssClasses

getCssClasses(): string[]

Gets list of css class names which applied to this node

Returns

string[]

Inherited from

AnnotatedWidget.getCssClasses


getCssTransform

getCssTransform(): string

Returns CSS transformation

Returns

string

Inherited from

AnnotatedWidget.getCssTransform


getData

getData(data?): object

get options

Parameters

Name Type Description
Optional dataunknownhow to extract data, null by default

Returns

object

Inherited from

AnnotatedWidget.getData


getDataSource

getDataSource(): DataSource

Returns current data source

Returns

DataSource


getDesiredHeight

getDesiredHeight(): string | number

Returns desired height of the group as a layoutable object This method is a helper method to get access to getLayoutStyle()

Returns

string | number

desired height ("undefined" by default)

Inherited from

AnnotatedWidget.getDesiredHeight


getDesiredWidth

getDesiredWidth(): string | number

Returns desired width of the group as a layoutable object. This method is a helper method to get access to getLayoutStyle()

Returns

string | number

desired width ("undefined" by default)

Inherited from

AnnotatedWidget.getDesiredWidth


getDeviceLimits

getDeviceLimits(): Rect

Return device limits

Returns

Rect

Inherited from

AnnotatedWidget.getDeviceLimits


getExportElement

getExportElement(options?): CompositeDocumentElement

Returns exportable element

Parameters

Name Type Description
Optional optionsExportElementOptionsoptions

Returns

CompositeDocumentElement

return exportable element

Inherited from

AnnotatedWidget.getExportElement


getExportLimits

getExportLimits(): Rect

Return export limits

Returns

Rect

Inherited from

AnnotatedWidget.getExportLimits


getExportScale

getExportScale(): Object

Gets export scale. By default scale is not set and equal to screen scale

Returns

Object

scale

NameTypeDescription
xnumberscale by x form model to device
ynumberscale by y form model to device

Inherited from

AnnotatedWidget.getExportScale


getExportState

Protected getExportState(): Record<string, any>

Returns export state

Returns

Record<string, any>

export state

Inherited from

AnnotatedWidget.getExportState


getFillStyle

getFillStyle(): FillStyle

Return fill style

Returns

FillStyle

fillStyle current fill style

Inherited from

AnnotatedWidget.getFillStyle


getId

getId(): string | number

Returns the associated identifier of the node

Returns

string | number

The node's id

Inherited from

AnnotatedWidget.getId


getInfiniteMode

getInfiniteMode(): boolean

Return infinity mode flag

Returns

boolean

flag

Inherited from

AnnotatedWidget.getInfiniteMode


getInvalidateMethod

Protected getInvalidateMethod(): AttributeCallback<EventDispatcher>

Gets invalidate method

Returns

AttributeCallback<EventDispatcher>

method to invalidate this object

Inherited from

AnnotatedWidget.getInvalidateMethod


getLayout

getLayout(): Layout

Returns layout associated with the group

Returns

Layout

layout

Inherited from

AnnotatedWidget.getLayout


getLayoutStyle

getLayoutStyle(): LayoutStyle<string | number>

return desired layout style

Returns

LayoutStyle<string | number>

Inherited from

AnnotatedWidget.getLayoutStyle


getLegend

getLegend(type?): Legend

Returns current legend shape

Parameters

Name Type
Optional typestring

Returns

Legend


getLegendLayer

getLegendLayer(): Group<Node>

Returns layer to keep legend on top of widget

Returns

Group<Node>

Inherited from

AnnotatedWidget.getLegendLayer


getLegendPanel

getLegendPanel(type?): ScrollablePanel

Returns scrollable panel containing current legend shape

Parameters

Name Type
Optional typestring

Returns

ScrollablePanel


getLegendPanels

getLegendPanels(): Record<string, ScrollablePanel>

Returns existing legend panels with its type string as key

Returns

Record<string, ScrollablePanel>


getLegendVisible

getLegendVisible(type?): boolean

Returns true if legend is enabled and visible

Parameters

Name Type Description
Optional typestringlegend type to check

Returns

boolean


getLegends

getLegends(): Record<string, Legend>

Returns existing legends with its type string as key

Returns

Record<string, Legend>


getLineStyle

getLineStyle(): LineStyle

Return border style

Returns

LineStyle

Inherited from

AnnotatedWidget.getLineStyle


getLocalTransform

getLocalTransform(): Transformation

Retrieves the transformation of bounds to parent

Returns

Transformation

transform the local transform.

Inherited from

AnnotatedWidget.getLocalTransform


getManipulatorLayer

getManipulatorLayer(): CompositeNode<Node>

return manipulator layer

Returns

CompositeNode<Node>

Inherited from

AnnotatedWidget.getManipulatorLayer


getMarginsStyle

getMarginsStyle(): SpaceStyle<string | number>

Return margins style

Returns

SpaceStyle<string | number>

Inherited from

AnnotatedWidget.getMarginsStyle


getModel

getModel(): Group<Node>

get model node

Returns

Group<Node>

Inherited from

AnnotatedWidget.getModel


getModelLimits

getModelLimits(): Rect

Gets model limits, the limits of this groups inside space

Returns

Rect

the current model limits

Inherited from

AnnotatedWidget.getModelLimits


getName

getName(): string

Returns the node name

Returns

string

The node name

Inherited from

AnnotatedWidget.getName


getOpacity

getOpacity(): number

Returns current node opacity

Returns

number

opacity

Inherited from

AnnotatedWidget.getOpacity


getOpacityBlendMode

getOpacityBlendMode(): BlendMode

Returns current node opacity

Returns

BlendMode

opacity blend mode

Inherited from

AnnotatedWidget.getOpacityBlendMode


getOverlay

getOverlay(index): Node

Return overlay at specified index

Parameters

Name Type Description
indexnumberindex at which to get the overlay for

Returns

Node

track

Inherited from

AnnotatedWidget.getOverlay


getOverlayAt

getOverlayAt(index): Node

Return overlay at specified index

Deprecated

since 4.2 use getOverlay instead

Parameters

Name Type Description
indexnumberindex at which to get the overlay for

Returns

Node

track

Inherited from

AnnotatedWidget.getOverlayAt


getOverlayLayer

getOverlayLayer(): Layer<Node>

Returns manipulator overlay to draw shapes that should move with the model

Returns

Layer<Node>

Inherited from

AnnotatedWidget.getOverlayLayer


getOverlays

getOverlays<S>(predicate, modify?): Iterator<Node>

Return iterator by overlays nodes

Type parameters

NameType
Sextends Node<S>

Parameters

Name Type Description
predicate(value: Node) => value is Sa filter function
Optional modifybooleanAn option to specify if the iterator supports adding/removing items from the collection. false by default.

Returns

Iterator<Node>

Inherited from

AnnotatedWidget.getOverlays

getOverlays(filter?, modify?): Iterator<Node>

Returns an iterator for child overlays. The iterator does not support adding or deleting items from overlays by default. If it is necessary to modify a collection of overlays, pass true as the last parameter.

Example

// Gets a writable iterator
const it = node.getOverlays(null, true);

Parameters

Name Type Description
Optional filter(node: Node) => booleanA filter function. Returns all overlays if null.
Optional modifybooleanAn option to specify if the iterator supports adding/removing items from the collection. false by default.

Returns

Iterator<Node>

An iterator for child overlays.

Inherited from

AnnotatedWidget.getOverlays


getOverlaysCount

getOverlaysCount(): number

Returns amount of overlays

Returns

number

Inherited from

AnnotatedWidget.getOverlaysCount


getPaddingStyle

getPaddingStyle(): SpaceStyle<string | number>

Return padding style

Returns

SpaceStyle<string | number>

padding

Inherited from

AnnotatedWidget.getPaddingStyle


getParent

getParent(): Node

Return parent node

Returns

Node

parent node

Inherited from

AnnotatedWidget.getParent


getPreferredSize

getPreferredSize(): Rect

Return preferred size to layout children

Returns

Rect

Inherited from

AnnotatedWidget.getPreferredSize


getProperties

getProperties(context?): OptionsOut

Returns properties

Parameters

Name Type Description
Optional contextISerializationContextserialization context

Returns

OptionsOut

properties

Overrides

AnnotatedWidget.getProperties


getProperty

getProperty(name): any

Gets dynamic property by name. These properties can be used as a property bags

Parameters

Name Type Description
namestringproperty name

Returns

any

Inherited from

AnnotatedWidget.getProperty


getPropertyKeys

getPropertyKeys(): string[]

Returns known properties keys

Returns

string[]

Inherited from

AnnotatedWidget.getPropertyKeys


getRenderingFilter

getRenderingFilter(): IFilter

Return filter to be used for rendering and picking

Returns

IFilter

current filter

Inherited from

AnnotatedWidget.getRenderingFilter


getResponsiveStyle

getResponsiveStyle(): ResponsiveStyle

Return responsive style

Returns

ResponsiveStyle

Inherited from

AnnotatedWidget.getResponsiveStyle


getRoot

getRoot(): Node

Returns root node.
If node doesn't have parent then it returns itself.

Returns

Node

the root node

Inherited from

AnnotatedWidget.getRoot


getScaleScrollStrategy

getScaleScrollStrategy(): Delegate

Gets ScaleScrollStrategy ("undefined" by default)

Returns

Delegate

ScaleScrollStrategy (see "setScaleScrollStrategy" description for more info)

Inherited from

AnnotatedWidget.getScaleScrollStrategy


getSceneTransform

getSceneTransform(): Transformation

Returns transformation from node to root scene

Returns

Transformation

a transformation from node to root scene

Inherited from

AnnotatedWidget.getSceneTransform


getSelectionMode

getSelectionMode(): SelectionMode

Returns selection mode for tooltip, selection and crosshair tools

Returns

SelectionMode


getSelectionRadius

getSelectionRadius(): number

Returns selection tool radius

Returns

number


getTag

getTag(): any

Returns the object associated with the node by user.

Returns

any

The node's user-object

Inherited from

AnnotatedWidget.getTag


getTitle

getTitle(): Object

Gets title properties of the widget

Returns

Object

NameTypeDescription
location?AnnotationLocationLocation of title
text?stringTitle text
textstyle?TextStyleText style
visible?booleanVisibility of title

getTool

getTool(): CompositeTool

Returns root tool associated to this widget

Returns

CompositeTool

Inherited from

AnnotatedWidget.getTool


getToolByName

getToolByName<T>(toolName): Tools[T]

Returns the tool matching the given name.
This function also accepts tool 'path' instead of absolute name.
For example:
getToolByName("compositeTool.panningTools.trackPanning.TrackPanning")
Would return the same tool as
getToolByName("TrackPanning")
As long as there is only one tool named "TrackPanning" in this composite
See listToolsNames()

Type parameters

NameType
Textends string

Parameters

Name Type Description
toolNameTThe tool name or path

Returns

Tools[T]

Overrides

AnnotatedWidget.getToolByName


getToolByType

getToolByType(toolType): AbstractTool

Returns the tool matching the given type. or null if nothing is matching the tool type
For example:
getToolByType(geotoolkit.controls.tools.Selection)
Would return the same tool as
getToolByName("pick")

Parameters

Name Type Description
toolTypeClassType<any>toolType of the tool

Returns

AbstractTool

Inherited from

AnnotatedWidget.getToolByType


getToolsOptions

getToolsOptions(): ToolsOptionsOut

Gets Tools Options

Returns

ToolsOptionsOut

JSON which defines tools options

Inherited from

AnnotatedWidget.getToolsOptions


getVisible

getVisible(): boolean

Return visibility of the node

Returns

boolean

true if node is visible

Inherited from

AnnotatedWidget.getVisible


getVisibleCenterModelLimits

getVisibleCenterModelLimits(ignoreModelLimits?): Rect

Returns visible model limits of the center model

Parameters

Name Type Description
Optional ignoreModelLimitsbooleanflag defines whether to ignore model limits or not. By default this option is false and visible limits will be intersected with center model limits

Returns

Rect

Inherited from

AnnotatedWidget.getVisibleCenterModelLimits


getVisibleDeviceLimits

getVisibleDeviceLimits(ignoreModelLimits?): Rect

Return visible device limits

Parameters

Name Type Description
Optional ignoreModelLimitsbooleanflag defines whether to ignore ModelLimits or not

Returns

Rect

Inherited from

AnnotatedWidget.getVisibleDeviceLimits


getVisibleModelLimits

getVisibleModelLimits(ignoreModelLimits?): Rect

Return visible model limits

Parameters

Name Type Description
Optional ignoreModelLimitsbooleanflag defines whether to ignore ModelLimits or not

Returns

Rect

Inherited from

AnnotatedWidget.getVisibleModelLimits


getWorldTransform

getWorldTransform(): Transformation

Retrieves the local transformation of the node which represents multiplication of parent to bounds and contents transformations.

Returns

Transformation

Inherited from

AnnotatedWidget.getWorldTransform


getZIndex

getZIndex(): number

Returns node z-index (null if not set)

Returns

number

Inherited from

AnnotatedWidget.getZIndex


hasCssClass

hasCssClass(cssClass): boolean

Check if node has specified css class

Parameters

Name Type Description
cssClassstringcss class name

Returns

boolean

Inherited from

AnnotatedWidget.hasCssClass


hasEventListener

hasEventListener(type, callback?): boolean

Check if a list of event listeners for this type contains this listener

Parameters

Name Type Description
typestringtype of event or property
Optional callbackFunctionto be called, if null, check if any callback is registered

Returns

boolean

Inherited from

AnnotatedWidget.hasEventListener


hitTest

hitTest(area, radius?): AbstractChart[]

Returns array of charts in provided area (in device)

Parameters

Name Type Description
areaPoint | Rectarea to select
Optional radiusnumberselection radius

Returns

AbstractChart[]


indexOfBaseLayer

indexOfBaseLayer(baseLayer): number

Return index of overlay ( index of the specified child or -1 if baseLayer is not found)

Parameters

Name Type Description
baseLayerNodebaseLayer to check index

Returns

number

Inherited from

AnnotatedWidget.indexOfBaseLayer


indexOfChart

indexOfChart(chart): number

Returns index of a chart (index of the specified chart or -1 if chart is not found)

Parameters

Name Type Description
chartAbstractChartchart to check index

Returns

number


indexOfChild

indexOfChild(node): number

Return index of child ( index of the specified child or -1 if node is not found)

Parameters

Name Type Description
nodeNodenode to check index

Returns

number

Inherited from

AnnotatedWidget.indexOfChild


indexOfOverlay

indexOfOverlay(overlay): number

Return index of overlay ( index of the specified child or -1 if overlay is not found)

Parameters

Name Type Description
overlayNodeoverlay to check index

Returns

number

Inherited from

AnnotatedWidget.indexOfOverlay


initializeFloatingAnnotationTool

Protected initializeFloatingAnnotationTool(): FloatingAnnotationTool

Returns

FloatingAnnotationTool

Inherited from

AnnotatedWidget.initializeFloatingAnnotationTool


initializeLayout

initializeLayout(settings): Group<Node>

Parameters

Name Type
settingsOptions

Returns

Group<Node>

Inherited from

AnnotatedWidget.initializeLayout


initializeTools

Protected initializeTools(options?): ChartWidget

function call in the constructor to initialize tools in the widget
This widget contains by default :

Parameters

Name Type Description
Optional optionsOptionstools options

Returns

ChartWidget

this

Overrides

AnnotatedWidget.initializeTools


insertAxis

insertAxis(axisIndex, axis, location, connectedObject?): Object

Insert new axis and connect with object

Parameters

Name Type Description
axisIndexnumberdesired axis index
axisAxis | Optionsnew axis instance or options
locationAnnotationLocationlocation of annotation for adding new axis
Optional connectedObjectGroup<Node>connected object of axis

Returns

Object

NameType
axisAxis
groupGroup<Node>

Overrides

AnnotatedWidget.insertAxis

insertAxis(axisIndex, options, location, connectedObject?): Object

Insert new axis and connect with object

Parameters

Name Type Description
axisIndexnumberdesired axis index
optionsPolarAxisOptionspolar axis options
locationPolarAnnotationLocationlocation of annotation for adding new axis
Optional connectedObjectGroup<Node>connected object of axis

Returns

Object

NameType
axisAxis
groupGroup<Node>

Overrides

AnnotatedWidget.insertAxis


insertBaseLayer

insertBaseLayer(index, baseLayer): ChartWidget

Insert child baseLayer at specified index

Parameters

Name Type Description
indexnumberspecified index
baseLayerNodea baseLayer to add

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.insertBaseLayer


insertChart

insertChart(index, options): ChartWidget

Inserts chart at specified index

Parameters

Name Type Description
indexnumberspecified index
optionsChartOptionschart options

Returns

ChartWidget

this


insertChild

insertChild(index, node): ChartWidget

Insert child node at specified index

Parameters

Name Type Description
indexnumberspecified index
nodeNodea child node to add

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.insertChild


insertOverlay

insertOverlay(index, overlay): ChartWidget

Insert child overlay at specified index

Parameters

Name Type Description
indexnumberspecified index
overlayNodea overlay to add

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.insertOverlay


invalidate

invalidate(bounds?, force?): ChartWidget

Invalidate node

Parameters

Name Type Description
Optional boundsRectoptional rectangular area to be invalidated, or force flag if rectangle is empty
Optional forcebooleanoptional boolean parameter that can force invalidation

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.invalidate


invalidateLayout

invalidateLayout(propagate?): ChartWidget

Notify that layout is invalidated. Send event Events.LayoutInvalidated

Parameters

Name Type Description
Optional propagatebooleanpropagate invalidate layout to parent

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.invalidateLayout


invalidateParent

invalidateParent(bounds?, force?): ChartWidget

Invalidate parent area

Parameters

Name Type Description
Optional boundsRectarea to invalidate
Optional forcebooleanforce

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.invalidateParent


inverseTransform

inverseTransform(src, chart, dst?): Point

Transforms point from device to chart model coordinates

Parameters

Name Type Description
srcPointpoint to transform
chartnumber | AbstractChartchart (or chart index) for model to transform
Optional dstPointdestination point

Returns

Point


isClippingEnabled

isClippingEnabled(): boolean

Returns if clipping is enabled or not for this node.

Returns

boolean

Inherited from

AnnotatedWidget.isClippingEnabled


isDisposed

isDisposed(): boolean

Returns whether this object has been disposed

Returns

boolean

Inherited from

AnnotatedWidget.isDisposed


isEventPropagationEnabled

isEventPropagationEnabled(): boolean

Return true if event propagation is enabled from child to parent

Returns

boolean

Inherited from

AnnotatedWidget.isEventPropagationEnabled


isHorizontalFlip

isHorizontalFlip(): boolean

Return true if the representation is flipped horizontally

Returns

boolean

flip

Inherited from

AnnotatedWidget.isHorizontalFlip


isLayoutInvalidated

isLayoutInvalidated(): boolean

Return true if layout is invalid

Returns

boolean

Inherited from

AnnotatedWidget.isLayoutInvalidated


isNotificationEnabled

isNotificationEnabled(): boolean

return state of notification

Returns

boolean

current notification state

Inherited from

AnnotatedWidget.isNotificationEnabled


isPickingChildrenEnabled

isPickingChildrenEnabled(): boolean

Returns if picking children is enabled or not for this node.

Returns

boolean

pickingChildren

Inherited from

AnnotatedWidget.isPickingChildrenEnabled


isSelectable

isSelectable(): boolean

Returns true if node can be picked/selected.

Returns

boolean

The selectable flag

Inherited from

AnnotatedWidget.isSelectable


isSilent

isSilent(): boolean

Return true if the event dispatcher doesn't notify any events

Returns

boolean

Inherited from

AnnotatedWidget.isSilent


isVerticalFlip

isVerticalFlip(): boolean

Return true if the representation is flipped vertically

Returns

boolean

flip

Inherited from

AnnotatedWidget.isVerticalFlip


listToolsNames

listToolsNames(): string[]

List all the tools contained in this composite. Prepend their parent tools parent using a '.'.

Returns

string[]

Inherited from

AnnotatedWidget.listToolsNames


loadTemplate

loadTemplate(template, registry?): ChartWidget

Load template

Parameters

Name Type Description
templatestringtemplate to be applied to the widget
Optional registryRegistryregistry

Returns

ChartWidget

this

Overrides

AnnotatedWidget.loadTemplate


moveTo

moveTo(area, vAlign?, hAlign?): ChartWidget

MoveTo position of node to specified area

Parameters

Name Type Description
areaRectspecified area
Optional vAlignstringvertical alignment. It can be "top", "bottom", "center".
Optional hAlignstringhorizontal alignment It can be "left", "right", "center".

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.moveTo


notify

notify<E>(type, source, args?): ChartWidget

Notify listeners of the Node

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event
sourceAnnotatedWidgetsource who called the event
Optional argsEventMap[E]event arguments

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.notify


notifyRoot

Protected notifyRoot(event, source, args?): Node

Notify an even to root node

Parameters

Name Type Description
eventstringtype of event
sourceNodesource who called the event
Optional argsanyevent arguments

Returns

Node

this

Inherited from

AnnotatedWidget.notifyRoot


off

off<E>(type?, callback?): ChartWidget

Detach listener on event. Calling .off() with no arguments removes all attached listeners. Calling .off(type) with no callback removes all attached listeners for specific type.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
Optional typeEtype of the event
Optional callback(eventType: E, sender: ChartWidget, args: EventMap[E]) => voidfunction to be called

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.off


on

on<E>(type, callback): ChartWidget

Attach listener on event that will be called whenever the specified event is delivered to the target

If the callback function is already in the list of event listeners for this target, the function is not added a second time.

If a particular anonymous function is in the list of event listeners registered for a certain target, and then later in the code, an identical anonymous function is given in an "on" call, the second function will also be added to the list of event listeners for that target.

Type parameters

NameType
Eextends string

Parameters

Name Type Description
typeEtype of event or property
callback(eventType: E, sender: ChartWidget, args: EventMap[E]) => voidto be called

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.on


onBoundsChanged

Protected onBoundsChanged(bounds): ChartWidget

Occurs when bounds has been changed

Parameters

Name Type Description
boundsRectbound of the node in the parent coordinates

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.onBoundsChanged


onChildAdded

Protected onChildAdded(child): void

This method is called it child or children are added

Parameters

Name Type Description
childNode | Iterator<Node>added child

Returns

void

Inherited from

AnnotatedWidget.onChildAdded


onChildRemoved

Protected onChildRemoved(child): void

This method is called it child or children are removed

Parameters

Name Type Description
childNoderemoved child

Returns

void

Inherited from

AnnotatedWidget.onChildRemoved


onParentChanged

Protected onParentChanged(node): ChartWidget

This method is called when parent changes. Do not call it directly.

Parameters

Name Type Description
nodeNodenode to change parent

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.onParentChanged


onVisibilityChanged

Protected onVisibilityChanged(): void

This method is called if visibility is changed. Send event Events.VisibilityChanged

Returns

void

Inherited from

AnnotatedWidget.onVisibilityChanged


pan

pan(dx, dy): ChartWidget

attempts to translate the model using the specific x, y translation

Fires

Events.ModelVisibleLimitsChanged

Parameters

Name Type Description
dxnumberrelative horizontal change
dynumberrelative vertical change

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.pan


panModelTo

panModelTo(target, animationOptions?): ChartWidget

Pans the content to the point.

Parameters

Name Type Description
targetPointPoint where to pan in model space
Optional animationOptionsPanAnimationOptionsAnimation options

Returns

ChartWidget

Inherited from

AnnotatedWidget.panModelTo


postRendering

Protected postRendering(context, callback?): void

To be called after rendering, used for PDF output

Parameters

Name Type Description
contextRenderingContextRendering Context
Optional callback() => voidcallback to be called after rendering

Returns

void

Inherited from

AnnotatedWidget.postRendering


preRendering

Protected preRendering(context, callback?): void

Occurs before child rendering

Parameters

Name Type Description
contextRenderingContextRendering Context
Optional callback() => voidcallback to be called after rendering of geometry

Returns

void

Inherited from

AnnotatedWidget.preRendering


rebuild

rebuild(force?, changes?): ChartWidget

Rebuild node. This method resets state, cache, and invalidate node.

Parameters

Name Type Description
Optional forcebooleanoptional boolean parameter that can force invalidation
Optional changesStateChangesoptional parameter to specify a reason of changes

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.rebuild


refreshLayout

refreshLayout(): ChartWidget

Refresh layout of inner components of the widget

Returns

ChartWidget

Inherited from

AnnotatedWidget.refreshLayout


registerAnimationStyle

registerAnimationStyle(root): void

Register animation style.

Parameters

Name Type Description
rootNoderoot node for node

Returns

void

Inherited from

AnnotatedWidget.registerAnimationStyle


removeAxis

removeAxis(axis): void

remove axis

Parameters

Name Type Description
axisAxisaxis to be removed

Returns

void

Overrides

AnnotatedWidget.removeAxis


removeBaseLayer

removeBaseLayer(baseLayer): ChartWidget

Remove child baseLayer

Parameters

Name Type Description
baseLayerNode | Node[]baseLayer or array of nodes to be removed

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.removeBaseLayer


removeChart

removeChart(index): ChartWidget

Removes chart at specified index

Parameters

Name Type Description
indexnumber | AbstractChartspecified index

Returns

ChartWidget

this


removeChild

removeChild(node, disposeChildren?): ChartWidget

Remove child node

Parameters

Name Type Description
nodeNode | Node[]node or array of nodes to be removed
Optional disposeChildrenbooleanautomatically dispose children. If it is true then method dispose is called for each child.

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.removeChild


removeCssClass

removeCssClass(cssclass): ChartWidget

Removes css class from node

Parameters

Name Type Description
cssclassstring | string[]css class name('s)

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.removeCssClass


removeInvalidateHandler

removeInvalidateHandler(handler): ChartWidget

Remove invalidate handler

Deprecated

since 4.0, use Node.off instead

Parameters

Name Type Description
handlerFunctionhandler to be notified about invalidation

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.removeInvalidateHandler


removeLegend

removeLegend(legendPanel): ChartWidget

remove legend

Parameters

Name Type
legendPanelLegendPanel

Returns

ChartWidget

Inherited from

AnnotatedWidget.removeLegend


removeOverlay

removeOverlay(overlay): ChartWidget

Remove child overlay

Parameters

Name Type Description
overlayNode | Node[]overlay or array of nodes to be removed

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.removeOverlay


removeTitle

removeTitle(location): void

remove title in the location

Parameters

Name Type Description
locationAnnotationLocationof the title

Returns

void

Inherited from

AnnotatedWidget.removeTitle


render

render(context): void

Render group

Parameters

Name Type Description
contextRenderingContextcontext to render group

Returns

void

Inherited from

AnnotatedWidget.render


renderAsync

renderAsync(context, callback): void

Render node in asynchronous mode. This implementation doesn't support cache for now.

Parameters

Name Type Description
contextRenderingContextThe rendering context to be used to draw the node
callback() => voidcallback function

Returns

void

Inherited from

AnnotatedWidget.renderAsync


renderBackground

Protected renderBackground(context, bounds): ChartWidget

Render background

Parameters

Name Type Description
contextRenderingContextcontext to render background
boundsRectgroup bounds

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.renderBackground


renderBaseLayers

Protected renderBaseLayers(context): ChartWidget

Render baseLayers on bottom of cache. This method does nothing, but can be implemented to render graphics on bottom of cache and between borders

Parameters

Name Type Description
contextRenderingContextcontext to render baseLayers

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.renderBaseLayers


renderBaseLayersAsync

Protected renderBaseLayersAsync(context, callback): void

Render baseLayers on bottom of cache in asynchronous mode. This method calls renderBaseLayers

Parameters

Name Type Description
contextRenderingContextcontext to render overlays
callback() => voidcallback function

Returns

void

Inherited from

AnnotatedWidget.renderBaseLayersAsync


renderChildren

Protected renderChildren(context): void

Render children

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

void

Inherited from

AnnotatedWidget.renderChildren


renderChildrenAsync

Protected renderChildrenAsync(context, callback): void

Render children async

Parameters

Name Type Description
contextRenderingContextRendering Context
callback() => voidcallback function to be called then all children are rendered

Returns

void

Inherited from

AnnotatedWidget.renderChildrenAsync


renderContent

Protected renderContent(context): void

render to specified context. This method calls preRendering, renderChildren, postRendering

Parameters

Name Type Description
contextRenderingContextRendering Context

Returns

void

Inherited from

AnnotatedWidget.renderContent


renderContentAsync

Protected renderContentAsync(context, callback): void

Render children in asynchronous mode

Parameters

Name Type Description
contextRenderingContextThe rendering context to be used to draw the node
callback() => voidcallback function to be called then all children are rendered

Returns

void

Inherited from

AnnotatedWidget.renderContentAsync


renderOverlays

Protected renderOverlays(context): ChartWidget

Render overlays on top of cache. This method does nothing, but can be implemented to render graphics on top of cache and between borders

Parameters

Name Type Description
contextRenderingContextcontext to render overlays

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.renderOverlays


renderOverlaysAsync

Protected renderOverlaysAsync(context, callback): void

Render overlays on top of cache in asynchronous mode. This method calls renderOverlays

Parameters

Name Type Description
contextRenderingContextcontext to render overlays
callback() => voidcallback function

Returns

void

Inherited from

AnnotatedWidget.renderOverlaysAsync


restoreToolState

restoreToolState(): ChartWidget

Restore tools state

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.restoreToolState


resumeUpdate

resumeUpdate(rebuild?, changes?): ChartWidget

Resume auto update

Parameters

Name Type Description
Optional rebuildbooleanforce rebuild
Optional changesStateChangesoptional parameter to specify a reason of changes

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.resumeUpdate


rotate

rotate(theta, x, y): ChartWidget

Rotate bounds around a given coordinate

Parameters

Name Type Description
thetanumberangle to rotate node, in radians
xnumberx coordinate to rotate around
ynumbery coordinate to rotate around

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.rotate


saveTemplate

saveTemplate(registry?, options?): string

Save template

Parameters

Name Type Description
Optional registryRegistryregistry
Optional optionsOptionsserialization options

Returns

string

return template as a string

Overrides

AnnotatedWidget.saveTemplate


saveToolsState

saveToolsState(): ChartWidget

Saves tools state

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.saveToolsState


scale

scale(xx, yy): ChartWidget

Scale node

Parameters

Name Type Description
xxnumberx scale factor
yynumbery scale factor

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.scale


scaleModel

scaleModel(xx, yy, posX?, posY?): ChartWidget

Scale node's contents.

Fires

Events.ModelVisibleLimitsChanged

Parameters

Name Type Description
xxnumberx scale factor
yynumbery scale factor
Optional posXnumberx position to scale from (in pxl)
Optional posYnumbery position to scale from (in pxl)

Returns

ChartWidget

Inherited from

AnnotatedWidget.scaleModel


setAnimationStyle

setAnimationStyle(animationStyle): ChartWidget

Sets animation style

Parameters

Name Type Description
animationStyleTypeanimation style

Returns

ChartWidget

Inherited from

AnnotatedWidget.setAnimationStyle


setAnnotationSize

setAnnotationSize(annotationSize?): ChartWidget

apply size (width or height) to annotation (convenience method)

Example

{
*   west : 50,
*   east : '10%',
*   south: 'auto'
* }

Parameters

Name Type Description
Optional annotationSizeAnnotationSizeJSON to hold (width or height) of the annotation

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setAnnotationSize


setAnnotationsOptions

setAnnotationsOptions(options): ChartWidget

Sets annotations' options. currently setAnnotationOptions can only modify existing annotation, while the constructor for the widget can create new ones.

Parameters

Name Type Description
optionsAnnotationOptionsJSON to hold annotations' options

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setAnnotationsOptions


setAutoModelLimitsMode

setAutoModelLimitsMode(mode): ChartWidget

Set Model Limits Logics to use when no Model Limits have been set set to true: will use parents width and height, starting at 0 set to false: will use parents bounds. This is convenient method. It creates AutoModelLimitsStrategy

Parameters

Name Type Description
modebooleanModel Limits Logics to be used

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setAutoModelLimitsMode


setAutoModelLimitsStrategy

setAutoModelLimitsStrategy(strategy): ChartWidget

Set Model Limits Logics Strategy

Parameters

Name Type Description
strategyModelLimitsStrategyModel Limits logic strategy to use

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setAutoModelLimitsStrategy


setBounds

setBounds(bounds): ChartWidget

Sets bounds of the node in the parent coordinates

Parameters

Name Type Description
boundsRect | Optionsbound of the node in the parent coordinates

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setBounds


setCache

setCache(cache, rebuild?): ChartWidget

Sets cache to be used to cache

Parameters

Name Type Description
cacheCachecache to be used
Optional rebuildbooleanrebuild cache

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setCache


setCenterModelLimits

setCenterModelLimits(modellimits): ChartWidget

Set the model limits of center model

Fires

Events.ModelVisibleLimitsChanged

Example

//artificially expand the widget model limits
import {Rect} from '@int/geotoolkit/util/Rect';
const newLimits = new Rect(0,0,10,10);
widget.setCenterModelLimits(newLimits);

Parameters

Name Type Description
modellimitsRectmodel limits

Returns

ChartWidget

Inherited from

AnnotatedWidget.setCenterModelLimits


setChild

setChild(index, node): ChartWidget

Replace child node by index

Parameters

Name Type Description
indexnumberindex of the node
nodeNodenode

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setChild


setClipStyle

setClipStyle(style): ChartWidget

Sets a new clipping style

Parameters

Name Type Description
styleGraphicsPath | ClipStyle | Optionsa new clipping style

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setClipStyle


setContentOrientation

setContentOrientation(orientation): ChartWidget

Set content orientation

Parameters

Name Type Description
orientationOrientationcontent orientation

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setContentOrientation


setCss

setCss(style, merge?): ChartWidget

Sets CSS style. This style will be applied for all inserted elements

Parameters

Name Type Description
styleTypeCSS style to be applied to inserted elements
Optional mergebooleanmerge flag

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setCss


setCssClass

setCssClass(name): ChartWidget

Sets css class name of the node to be used to apply CSS style

Parameters

Name Type Description
namestringcss class name of the node

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setCssClass


setCssTransform

setCssTransform(transform): ChartWidget

Set CSS transformation

Parameters

Name Type Description
transformstring | Transformationtransformation css transformation instruction or Transformation instance

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setCssTransform


setDataSource

setDataSource(data): ChartWidget

Sets data source used for the chart in the widget

Parameters

Name Type Description
dataDataSource | AbstractDataTabledata series

Returns

ChartWidget

this


setDesiredHeight

setDesiredHeight(value, silent?): ChartWidget

Sets desired height of the group as a layoutable object

Parameters

Name Type Description
valuestring | numberdesired height to set, use 'auto' for automatic desired height
Optional silentbooleansilent setting

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setDesiredHeight


setDesiredWidth

setDesiredWidth(value, silent?): ChartWidget

Sets desired width of the group as a layoutable object

Parameters

Name Type Description
valuestring | numberdesired width to set
Optional silentbooleansilent setting

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setDesiredWidth


setExportLimits

setExportLimits(limits): ChartWidget

Sets export limits

Parameters

Name Type Description
limitsRectexport limits

Returns

ChartWidget

Inherited from

AnnotatedWidget.setExportLimits


setExportScale

setExportScale(scale): ChartWidget

Sets export scale.

Parameters

Name Type Description
scaleObjectscale
scale.xnumberscale by x form model to device
scale.ynumberscale by y form model to device

Returns

ChartWidget

Inherited from

AnnotatedWidget.setExportScale


setFillStyle

setFillStyle(fillStyle, merge?): ChartWidget

Sets fill style

Parameters

Name Type Description
fillStyleTypea new fill style
Optional mergebooleantrue if you want to merge fillStyle with existing attribute, false by default

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setFillStyle


setHorizontalFlip

setHorizontalFlip(enable): ChartWidget

Set horizontal flip of the representation

Parameters

Name Type Description
enablebooleanenable flip

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setHorizontalFlip


setId

setId(id): ChartWidget

Allows the user to associate any identifier

Parameters

Name Type Description
idstring | numberobject id

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setId


setInfiniteMode

setInfiniteMode(infinityMode): ChartWidget

Set infinity mode flag to draw composite without collision check

Parameters

Name Type Description
infinityModebooleaninfinity mode flag

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setInfiniteMode


setLayout

setLayout(layout): ChartWidget

Associate layout with a group.

Parameters

Name Type Description
layoutRecord<string, any> | Layoutlayout instance to be set or layout properties to apply

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setLayout


setLayoutInvalidated

Protected setLayoutInvalidated(invalidated): void

Set invalidation status

Parameters

Name Type Description
invalidatedbooleaninvalidated layout

Returns

void

Inherited from

AnnotatedWidget.setLayoutInvalidated


setLayoutStyle

setLayoutStyle(layoutStyle, silent?, merge?): ChartWidget

specify desired layout style

Parameters

Name Type Description
layoutStyleLayoutStyle<string | number> | Options<string | number>desired layout style
Optional silentbooleansilent setting
Optional mergebooleantrue if you want to merge layoutStyle with existing attribute, false by default

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setLayoutStyle


setLineStyle

setLineStyle(lineStyle, merge?): ChartWidget

Sets border color Returns this

Parameters

Name Type Description
lineStyleTypeline style or options
Optional mergebooleantrue if you want to merge lineStyle with existing attribute, false by default

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setLineStyle


setLocalTransform

setLocalTransform(localTransform, force?): ChartWidget

Sets local transformation to be used to transform from local to parent coordinate

Parameters

Name Type Description
localTransformTransformationlocal transformation for this node
Optional forcebooleanboolean flag to force update event if transformations are equal, false by default

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setLocalTransform


setMarginsStyle

setMarginsStyle(margins, merge?): ChartWidget

Sets margins style

Parameters

Name Type Description
marginsType<string | number>margins style
Optional mergebooleantrue if you want to merge marginsStyle with existing attribute, false by default

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setMarginsStyle


setModelLimits

setModelLimits(limits): ChartWidget

Sets inner model limits

Parameters

Name Type Description
limitsTypeinner limits

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setModelLimits


setModelTransformation

setModelTransformation(transformation): ChartWidget

Attempts to set local transformation for the model. NOTE: the local transformation set may not be equal to transformation passed - it depends on current ScaleScrollStrategy set on the node.

Parameters

Name Type Description
transformationTransformationtransformation to set

Returns

ChartWidget

Inherited from

AnnotatedWidget.setModelTransformation


setName

setName(name): ChartWidget

Sets name of the node

Parameters

Name Type Description
namestringThe node name

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setName


setNotification

setNotification(notify, force?): ChartWidget

set notification state

Parameters

Name Type Description
notifybooleanflag set to invalidate parent or not
Optional forcebooleantrue if parent should be invalidated immediately

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setNotification


setOpacity

setOpacity(opacity, blendMode?): ChartWidget

Sets node opacity

Parameters

Name Type Description
opacitynumbernode opacity from 0 to 1
Optional blendModeBlendModeopacity blend mode. If it is normal, opacity will be replaced.

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setOpacity


setPaddingStyle

setPaddingStyle(paddingStyle, merge?): ChartWidget

Sets padding style

Parameters

Name Type Description
paddingStyleType<string | number>padding style
Optional mergebooleantrue if you want to merge paddingStyle with existing attribute, false by default

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setPaddingStyle


setProperties

setProperties(options?): ChartWidget

Sets properties

Parameters

Name Type Description
Optional optionsOptionsproperties

Returns

ChartWidget

this

Overrides

AnnotatedWidget.setProperties


setProperty

setProperty(name, value): ChartWidget

Sets dynamic property by name

Parameters

Name Type Description
namestringproperty name
valueanyproperty value

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setProperty


setRenderingFilter

setRenderingFilter(filter): ChartWidget

Sets filter to be applied before rendering and picking

Parameters

Name Type Description
filterIFilterfilter to set

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setRenderingFilter


setResponsiveStyle

setResponsiveStyle(style): ChartWidget

Sets responsive style.

Parameters

Name Type Description
styleOptions | ResponsiveStyleresponsive style

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setResponsiveStyle


setScaleScrollStrategy

setScaleScrollStrategy(delegate): ChartWidget

set the scale scroll strategy to apply to the widget

Parameters

Name Type Description
delegateDelegatescaleScrollStrategy to set

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setScaleScrollStrategy


setSelectable

setSelectable(selectable): ChartWidget

Allows to select node. If node is not selectable then child node is not selectable.

Parameters

Name Type Description
selectablebooleanflag to allow node selection

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setSelectable


setSelectionMode

setSelectionMode(mode): ChartWidget

Sets selection mode for tooltip, selection and crosshair tools

Parameters

Name Type
modeSelectionMode

Returns

ChartWidget


setSilent

setSilent(bool): ChartWidget

Set silent mode

Parameters

Name Type Description
boolbooleanflag to enable silent mode

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setSilent


setTag

setTag(tag): ChartWidget

Allows the user to associate any arbitrary object with the node.

Parameters

Name Type Description
taganyThe object to be associated with the node.

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setTag


setTitle

setTitle(titleOptions): ChartWidget

Sets title of the widget

Parameters

Name Type Description
titleOptionsObjectoptions of the title
Optional titleOptions.locationAnnotationLocationLocation of title
Optional titleOptions.paddingstyleType<string | number>inner padding style in device coordinates
Optional titleOptions.textstringText to display
Optional titleOptions.textstyleTypeText style to apply to title
Optional titleOptions.visiblebooleanVisibility of title

Returns

ChartWidget


setTitleOptions

setTitleOptions(location, options): ChartWidget

set options for title

Parameters

Name Type Description
locationAnnotationLocationof the title
optionsOmit<TitleOptions, "location">title options

Returns

ChartWidget

Inherited from

AnnotatedWidget.setTitleOptions


setTool

Protected setTool(tool): ChartWidget

Set root tool associated to this widget

Parameters

Name Type Description
toolCompositeTooltool to be set

Returns

ChartWidget

Inherited from

AnnotatedWidget.setTool


setToolCustomModeEnabled

setToolCustomModeEnabled(tool, enabled): ChartWidget

Enables/disables custom system tool mode for widget based on current system (custom Rubberband selection, crosshair etc.)

Parameters

Name Type Description
toolAbstractTooltool to be changed into default/system mode
enabledbooleantrue to enable system-based mode, false otherwise

Returns

ChartWidget


setToolsOptions

setToolsOptions(options?): ChartWidget

Set Tools Options

Example

//To prevent the selection tool from deselecting the previously selected points, for example  user can do the following:
annotatedWidget.setToolsOptions({
'selection': {
'resetselection': false
}
});

Parameters

Name Type Description
Optional optionsToolsOptionsJSON which defines tools options

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setToolsOptions


setVerticalFlip

setVerticalFlip(flip): ChartWidget

Set vertical flip of the representation

Parameters

Name Type Description
flipbooleanflag to set the vertical flip of the representation

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setVerticalFlip


setVisible

setVisible(value): ChartWidget

Sets visibility of the node. Send event Events.VisibilityChanged

Parameters

Name Type Description
valuebooleanflag specifying visibility of the node

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setVisible


setVisibleCenterModelLimits

setVisibleCenterModelLimits(newVisibleModelLimits): ChartWidget

Attempts to set model's visible limits to specified limits. NOTE: the limits set may not be equal to the limit passed - it depends on current ScaleScrollStrategy set on the node.

Fires

Events.ModelVisibleLimitsChanged

Parameters

Name Type Description
newVisibleModelLimitsRectlimits to set

Returns

ChartWidget

Inherited from

AnnotatedWidget.setVisibleCenterModelLimits


setVisibleModelLimits

setVisibleModelLimits(newVisibleModelLimits): ChartWidget

Attempts to set model's visible limits to specified limits. NOTE: the limits set may not be equal to the limit passed - it depends on current ScaleScrollStrategy set on the node.

Parameters

Name Type Description
newVisibleModelLimitsRectlimits to set

Returns

ChartWidget

Inherited from

AnnotatedWidget.setVisibleModelLimits


setZIndex

setZIndex(value): ChartWidget

Sets z-index for node (set null for default)

Parameters

Name Type Description
valuenumberindex determining node z-position

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.setZIndex


shear

shear(shx, shy): ChartWidget

Shear this node's bounds

Parameters

Name Type Description
shxnumberx-axis shear
shynumbery-axis shear

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.shear


suspendUpdate

suspendUpdate(): ChartWidget

Suspend auto update

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.suspendUpdate


swapAxes

swapAxes(axis1, axis2): ChartWidget

Swap axes ("canSwapAxes" must be called first).
see ChartWidget.canSwapAxes description for invalid swap cases

Throws

Error if swapping axes is not doable

Parameters

Name Type Description
axis1Axisfirst axis
axis2Axissecond axis

Returns

ChartWidget

this


synchronizeViewLimits

Protected synchronizeViewLimits(): ChartWidget

Returns

ChartWidget

Inherited from

AnnotatedWidget.synchronizeViewLimits


toString

toString(): string

Returns a string representation of this object (generally the classname)

Returns

string

A string representation

Inherited from

AnnotatedWidget.toString


tooltipTitleFormat

tooltipTitleFormat(): string

Formats selection info for tooltip purposes, all info is shared between charts

Returns

string


transform

transform(src, chart, dst?): Point

Transforms point from chart model coordinates to device

Parameters

Name Type Description
srcPointpoint to transform
chartnumber | AbstractChartchart (or chart index) for model to transform
Optional dstPointdestination point

Returns

Point


translate

translate(tx, ty): ChartWidget

Translate bounds

Parameters

Name Type Description
txnumberx translation
tynumbery translation

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.translate


translateModel

translateModel(tx, ty): ChartWidget

Translates widget's contents.

Fires

Events.ModelVisibleLimitsChanged

Parameters

Name Type Description
txnumberx translation
tynumbery translation

Returns

ChartWidget

Inherited from

AnnotatedWidget.translateModel


unregisterAnimationStyle

unregisterAnimationStyle(root): void

Unregister animation style.

Parameters

Name Type Description
rootAnimatedNoderoot node for node

Returns

void

Inherited from

AnnotatedWidget.unregisterAnimationStyle


updateLayout

updateLayout(targets?): ChartWidget

Updates layout(s)

Fires

Events.LayoutUpdated

Parameters

Name Type Description
Optional targetsILayoutable[]optional parameter about which element to layout

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.updateLayout


updateSceneTransformation

updateSceneTransformation(): ChartWidget

Update scene transformation

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.updateSceneTransformation


updateState

updateState(regions?, changes?): ChartWidget

Update state. These methods reset node state and update state for children. this method is useful to refresh a scene graph

Parameters

Name Type Description
Optional regionsRect[]optional array to return invalid rectangles in the parent coordinates
Optional changesStateChangesoptional parameter to specify a reason of changes

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.updateState


updateSuspended

updateSuspended(): boolean

Return state of suspend state

Returns

boolean

state of update

Inherited from

AnnotatedWidget.updateSuspended


updateTimeStamp

Protected updateTimeStamp(): ChartWidget

Update time stamp to indicate that Node or Children has been changed.

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.updateTimeStamp


zoomIn

zoomIn(): ChartWidget

zoom in, with default factor = 5/4

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.zoomIn


zoomOut

zoomOut(): ChartWidget

zoom out, with default factor = 5/4

Returns

ChartWidget

this

Inherited from

AnnotatedWidget.zoomOut


zoomToRect

zoomToRect(limits?): void

Sets visible model limits

Fires

Events.ModelVisibleLimitsChanged

Parameters

Name Type Description
Optional limitsRectthe visible model limits

Returns

void

Inherited from

AnnotatedWidget.zoomToRect


enableSceneGraphNotification

Static enableSceneGraphNotification(enabled): void

Enable / disable all notifications

Parameters

Name Type Description
enabledbooleansets if this object sends notifications

Returns

void

Inherited from

AnnotatedWidget.enableSceneGraphNotification


findParent

Static findParent<T>(node, classType, filter?): InstanceType<T>

Find root of the node with specified type

Type parameters

NameType
Textends Constructor<any>

Parameters

Name Type Description
nodeNodenode to start search
classTypeTtype of the class to search for
Optional filter(node: Node) => booleanadditional filter to apply

Returns

InstanceType<T>

Inherited from

AnnotatedWidget.findParent

Static findParent(node, classType, filter?): Node

Find root of the node with specified type

Parameters

Name Type Description
nodeNodenode to start search
classTypestringinterface name to search for
Optional filter(node: Node) => booleanadditional filter to apply

Returns

Node

Inherited from

AnnotatedWidget.findParent


getClassName

Static getClassName(): string

Returns

string

Inherited from

AnnotatedWidget.getClassName


isSceneGraphNotificationEnabled

Static isSceneGraphNotificationEnabled(): boolean

Return status of the global notification for all nodes.

Returns

boolean

Inherited from

AnnotatedWidget.isSceneGraphNotificationEnabled