Interface: ISeriesPrimitiveBase<TSeriesAttachedParameters>
Base interface for series primitives. It must be implemented to add some external graphics to series
Type parameters
Name | Type |
---|---|
TSeriesAttachedParameters | unknown |
Methods
updateAllViews
▸ Optional
updateAllViews(): void
This method is called when viewport has been changed, so primitive have to recalculate / invalidate its data
Returns
void
priceAxisViews
▸ Optional
priceAxisViews(): readonly ISeriesPrimitiveAxisView
[]
Returns array of labels to be drawn on the price axis used by the series
Returns
readonly ISeriesPrimitiveAxisView
[]
array of objects; each of then must implement ISeriesPrimitiveAxisView interface
For performance reasons, the lightweight library uses internal caches based on references to arrays So, this method must return new array if set of views has changed and should try to return the same array if nothing changed
timeAxisViews
▸ Optional
timeAxisViews(): readonly ISeriesPrimitiveAxisView
[]
Returns array of labels to be drawn on the time axis
Returns
readonly ISeriesPrimitiveAxisView
[]
array of objects; each of then must implement ISeriesPrimitiveAxisView interface
For performance reasons, the lightweight library uses internal caches based on references to arrays So, this method must return new array if set of views has changed and should try to return the same array if nothing changed
paneViews
▸ Optional
paneViews(): readonly ISeriesPrimitivePaneView
[]
Returns array of objects representing primitive in the main area of the chart
Returns
readonly ISeriesPrimitivePaneView
[]
array of objects; each of then must implement ISeriesPrimitivePaneView interface
For performance reasons, the lightweight library uses internal caches based on references to arrays So, this method must return new array if set of views has changed and should try to return the same array if nothing changed
priceAxisPaneViews
▸ Optional
priceAxisPaneViews(): readonly ISeriesPrimitivePaneView
[]
Returns array of objects representing primitive in the price axis area of the chart
Returns
readonly ISeriesPrimitivePaneView
[]
array of objects; each of then must implement ISeriesPrimitivePaneView interface
For performance reasons, the lightweight library uses internal caches based on references to arrays So, this method must return new array if set of views has changed and should try to return the same array if nothing changed
timeAxisPaneViews
▸ Optional
timeAxisPaneViews(): readonly ISeriesPrimitivePaneView
[]
Returns array of objects representing primitive in the time axis area of the chart
Returns
readonly ISeriesPrimitivePaneView
[]
array of objects; each of then must implement ISeriesPrimitivePaneView interface
For performance reasons, the lightweight library uses internal caches based on references to arrays So, this method must return new array if set of views has changed and should try to return the same array if nothing changed
autoscaleInfo
▸ Optional
autoscaleInfo(startTimePoint
, endTimePoint
): AutoscaleInfo
Return autoscaleInfo which will be merged with the series base autoscaleInfo. You can use this to expand the autoscale range to include visual elements drawn outside of the series' current visible price range.
Important: Please note that this method will be evoked very often during scrolling and zooming of the chart, thus it is recommended that this method is either simple to execute, or makes use of optimisations such as caching to ensure that the chart remains responsive.
Parameters
Name | Type | Description |
---|---|---|
startTimePoint | Logical | start time point for the current visible range |
endTimePoint | Logical | end time point for the current visible range |
Returns
AutoscaleInfo
attached
▸ Optional
attached(param
): void
Attached Lifecycle hook.
Parameters
Name | Type | Description |
---|---|---|
param | TSeriesAttachedParameters | An object containing useful references for the attached primitive to use. |
Returns
void
void
detached
▸ Optional
detached(): void
Detached Lifecycle hook.
Returns
void
void
hitTest
▸ Optional
hitTest(x
, y
): PrimitiveHoveredItem
Hit test method which will be called by the library when the cursor is moved. Use this to register object ids being hovered for use within the crosshairMoved and click events emitted by the chart. Additionally, the hit test result can specify a preferred cursor type to display for the main chart pane. This method should return the top most hit for this primitive if more than one object is being intersected.
Parameters
Name | Type | Description |
---|---|---|
x | number | x Coordinate of mouse event |
y | number | y Coordinate of mouse event |