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.
Returns
void
getAnchoredPosition
▸ getAnchoredPosition(): PositionPercents
Get the position percents of a fixed drawing.
Returns
getPoints
▸ getPoints(): PricedPoint[]
Returns the points of the drawing.
Returns
getProperties
▸ getProperties<P>(target?, nopack?): P
Get all the properties of the drawing.
Type parameters
| Name | Type |
|---|---|
P | extends Record<string, any> = Record<string, any> |
Parameters
| Name | Type |
|---|---|
target? | PropertyKeyType |
nopack? | boolean |
Returns
P
properties of the drawing
Nopack
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.
Returns
void
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
| Name | Type | Description |
|---|---|---|
positionPercents | PositionPercents | The new position percents. |
Returns
void
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
| Name | Type | Description |
|---|---|---|
points | ShapePoint[] | The new points. |
Returns
void
setProperties
▸ setProperties<P>(newProperties, saveDefaults?): void
Sets the properties of the drawing.
Type parameters
| Name | Type |
|---|---|
P | extends Record<string, any> = Record<string, any> |
Parameters
| Name | Type | Description |
|---|---|---|
newProperties | P | 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. |
saveDefaults? | boolean | If true, the properties will be saved as defaults for the drawing. Defaults are used when the drawing is created. |
Returns
void
setSavingEnabled
▸ setSavingEnabled(enable): void
Enables or disables saving of the drawing in the chart layout (see disableSave option of createMultipointShape).
Parameters
| Name | Type | Description |
|---|---|---|
enable | boolean | if true, the drawing can be saved to the chart |
Returns
void
setSelectionEnabled
▸ setSelectionEnabled(enable): void
Set whether the drawing can be selected by the user or not.
Parameters
| Name | Type | Description |
|---|---|---|
enable | boolean | if true then the user can select the drawing (see disableSelection option of createMultipointShape) |
Returns
void
setShowInObjectsTreeEnabled
▸ setShowInObjectsTreeEnabled(enabled): void
Enables or disables the visibility of the drawing in the Object Tree panel
Parameters
| Name | Type | Description |
|---|---|---|
enabled | boolean | if true then the drawing will be visible |
Returns
void
setUserEditEnabled
▸ setUserEditEnabled(enabled): void
Enables or disables whether the drawing is editable
Parameters
| Name | Type | Description |
|---|---|---|
enabled | boolean | if true, then the drawing will be editable |
Returns
void