Skip to main content

ILineDataSourceApi

Interface

Drawing API

You can retrieve this interface by using the IChartWidgetApi.getShapeById method.

Methods

bringToFront

Places the drawing on top of all other chart objects.

Signature

bringToFront() => void

Returns

void


getAnchoredPosition

Get the position percents of a fixed drawing.

Signature

getAnchoredPosition() => PositionPercents

Returns

PositionPercents


getPoints

Returns the points of the drawing.

Signature

getPoints() => PricedPoint[]

Returns

PricedPoint[]


getProperties

Get all the properties of the drawing.

Signature

getProperties() => Record<string, any>

Returns

properties of the drawing

Record<string, any>


isSavingEnabled

Can the drawing be saved in the chart layout

Signature

isSavingEnabled() => boolean

Returns

true when the drawing can be saved

boolean


isSelectionEnabled

Is the drawing selectable by the user.

Signature

isSelectionEnabled() => boolean

Returns

true when the drawing can be selected

boolean


isShowInObjectsTreeEnabled

Is the drawing shown in the Object Tree Panel

Signature

isShowInObjectsTreeEnabled() => boolean

Returns

true when the drawing is visible in the tree.

boolean


isUserEditEnabled

Is the drawing editable by the user.

Signature

isUserEditEnabled() => boolean

Returns

true when the drawing is editable

boolean


sendToBack

Places the drawing behind all other chart objects.

Signature

sendToBack() => void

Returns

void


setAnchoredPosition

Set the position percents for a fixed drawing. For example setPoints([{ x: 0.1, y: 0.1 }]) would set a fixed drawing defined by a single point to be 10% top the left edge of the chart and 10% from the top edge.

Signature

setAnchoredPosition(positionPercents: PositionPercents) => void

Parameters

NameTypeDescription
positionPercentsPositionPercentsThe new position percents.

Returns

void


setPoints

Set the new points of the drawing. All points must be provided: for example if the drawing is defined by 5 points then all 5 must be provided.

Signature

setPoints(points: ShapePoint[]) => void

Parameters

NameTypeDescription
pointsShapePoint[]The new points.

Returns

void


setProperties

Sets the properties of the drawing.

Signature

setProperties(newProperties: object, saveDefaults?: boolean) => void

Parameters

NameTypeDescription
newPropertiesobjectDrawing properties to be set on the drawing. It should have the same structure as an object from ILineDataSourceApi.getProperties. It can only include the properties that you want to override.
saveDefaults?booleanIf true, the properties will be saved as defaults for the drawing. Defaults are used when the drawing is created.

Returns

void


setSavingEnabled

Enables or disables saving of the drawing in the chart layout (see disableSave option of createMultipointShape).

Signature

setSavingEnabled(enable: boolean) => void

Parameters

NameTypeDescription
enablebooleanif true, the drawing can be saved to the chart

Returns

void


setSelectionEnabled

Set whether the drawing can be selected by the user or not.

Signature

setSelectionEnabled(enable: boolean) => void

Parameters

NameTypeDescription
enablebooleanif true then the user can select the drawing (see disableSelection option of createMultipointShape)

Returns

void


setShowInObjectsTreeEnabled

Enables or disables the visibility of the drawing in the Object Tree panel

Signature

setShowInObjectsTreeEnabled(enabled: boolean) => void

Parameters

NameTypeDescription
enabledbooleanif true then the drawing will be visible

Returns

void


setUserEditEnabled

Enables or disables whether the drawing is editable

Signature

setUserEditEnabled(enabled: boolean) => void

Parameters

NameTypeDescription
enabledbooleanif true, then the drawing will be editable

Returns

void