ILineDataSourceApi
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
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
Name | Type | Description |
---|---|---|
positionPercents | PositionPercents | The 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
Name | Type | Description |
---|---|---|
points | ShapePoint[] | The new points. |
Returns
void
setProperties
Sets the properties of the drawing.
Signature
setProperties(newProperties: object) => void
Parameters
Name | Type | Description |
---|---|---|
newProperties | object | Drawing 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. |
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
Name | Type | Description |
---|---|---|
enable | boolean | if 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
Name | Type | Description |
---|---|---|
enable | boolean | if 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
Name | Type | Description |
---|---|---|
enabled | boolean | if true then the drawing will be visible |
Returns
void
setUserEditEnabled
Enables or disables whether the drawing is editable
Signature
setUserEditEnabled(enabled: boolean) => void
Parameters
Name | Type | Description |
---|---|---|
enabled | boolean | if true , then the drawing will be editable |
Returns
void