Skip to main content

Interface: ILineDataSourceApi

Charting Library.ILineDataSourceApi

Drawing API

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

Methods​

bringToFront​

bringToFront(): void

Places the drawing on top of all other chart objects.


getAnchoredPosition​

getAnchoredPosition(): PositionPercents

Get the position percents of a fixed drawing.

Returns​

PositionPercents


getPoints​

getPoints(): PricedPoint[]

Returns the points of the drawing.

Returns​

PricedPoint[]


getProperties​

getProperties<P>(target?, nopack?): P

Get all the properties of the drawing.

Type parameters​

NameType
Pextends Record<string, any> = Record<string, any>

Parameters​

NameType
target?PropertyKeyType
nopack?boolean

Returns​

P — properties of the drawing

some shapes line fib retracement could provide properties in a packed format (using arrays instead of objects). This flag allows controlling this.


isSavingEnabled​

isSavingEnabled(): boolean

Can the drawing be saved in the chart layout

Returns​

boolean — true when the drawing can be saved


isSelectionEnabled​

isSelectionEnabled(): boolean

Is the drawing selectable by the user.

Returns​

boolean — true when the drawing can be selected


isShowInObjectsTreeEnabled​

isShowInObjectsTreeEnabled(): boolean

Is the drawing shown in the object tree panel

Returns​

boolean — true when the drawing is visible in the tree.


isUserEditEnabled​

isUserEditEnabled(): boolean

Is the drawing editable by the user.

Returns​

boolean — true when the drawing is editable


sendToBack​

sendToBack(): void

Places the drawing behind all other chart objects.


setAnchoredPosition​

setAnchoredPosition(positionPercents): void

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.

Parameters​

NameTypeDescription
positionPercentsPositionPercentsThe new position percents.

setPoints​

setPoints(points): void

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.

Parameters​

NameTypeDescription
pointsShapePoint[]The new points.

setProperties​

setProperties<P>(newProperties, saveDefaults?): void

Sets the properties of the drawing.

Type parameters​

NameType
Pextends Record<string, any> = Record<string, any>

Parameters​

NameTypeDescription
newPropertiesPDrawing 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.

setSavingEnabled​

setSavingEnabled(enable): void

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

Parameters​

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

setSelectionEnabled​

setSelectionEnabled(enable): void

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

Parameters​

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

setShowInObjectsTreeEnabled​

setShowInObjectsTreeEnabled(enabled): void

Enables or disables the visibility of the drawing in the object tree panel

Parameters​

NameTypeDescription
enabledbooleanif true then the drawing will be visible

setUserEditEnabled​

setUserEditEnabled(enabled): void

Enables or disables whether the drawing is editable

Parameters​

NameTypeDescription
enabledbooleanif true, then the drawing will be editable