Creates an instance of the CursorModifier
If number of renderable series is more then 10 and showTooltip enabled consider passing TCursorTooltipDataTemplate or TCursorTooltipSvgTemplate to reduce the output for the tooltip
Optional parameters ICursorModifierOptions used to configure the modifier
Stores info about active pointerdown events
Gets or sets the axis label corner/border radius, in pixels
Gets or sets both axis label fill as an HTML Color code.
Gets or sets the axis label padding
Gets or sets both axis label text color as an HTML Color code
Gets or sets the crosshair line dash array
Gets or sets the crosshair line strokethickness
If this is set greater than the default of zero, the toolip will only show values for points in this radius, rather than all points on the vertical line
A unique Id for the IChartModifierBase
The helper property to get and set the list of included renderable series
The helper property to get and set the list of included X axes
The helper property to get and set the list of included Y axes
A callback to invalidate the parent SciChartSurfaceBase
Specifies a string ID to group modifiers.
Gets or sets whether we should display the tooltip. Default is false
Gets or sets the tooltip container background color as an HTML Color code
Gets or sets the legend X offset
Gets or sets the legend Y offset
Gets or sets the template for the legend
Get or set a function which generates the svg for the entire tooltip. Note that the repositioning of the tooltip to keep it within the chart is normally done in this function. To retain this functionality in your own template function, include the following:
// valuesWithLabels is the result of the tooltipDataTemplate function, which is the text content of the tooltip as an array of strings
const { width, height } = calcTooltipSize(valuesWithLabels);
// this calculates and sets svgAnnotation.xCoordShift and svgAnnotation.yCoordShift. Do not set x1 or y1 at this point.
adjustTooltipPosition(width, height, svgAnnotation);
Gets or sets the tooltip text color as an HTML Color code
Gets or sets the xAxis label fill as an HTML Color code.
Gets or sets the xAxis label text color as an HTML Color code
Direction to which the modifier can be applied
Gets or sets the yAxis label fill as an HTML Color code.
Gets or sets the xAxis label text color as an HTML Color code
When true, this modifier can receive mouse events
Gets or sets the crosshair line Stroke color as an HTML Color code
Gets or sets the crosshair line Stroke color as an HTML Color code
The primary action execute condition that modifier should respond to
The primary action execute condition that modifier should respond to
When true, the modifier is attached to a SciChartSurfaceBase
When true, the modifier is enabled
When true, the modifier is enabled
Gets or sets whether we should draw the Line & Tooltips only using SVG, else they will be drawn natively.
Gets or sets whether we should draw the Line & Tooltips only using SVG, else they will be drawn natively.
The type of Chart Modifier, see EModifierType for a list of values
Gets or sets the parent div element reference or id for the Tooltip
Gets or sets the parent div element reference or id for the Tooltip
When true, this modifier should receive events which have been handled by modifiers higher up in the call hierachy.
When true, this modifier should receive events which have been handled by modifiers higher up in the call hierachy.
The secondary action execute condition that modifier should respond to
The secondary action execute condition that modifier should respond to
Gets or sets whether we should display the Axis Labels. Default is true
Gets or sets whether we should display the Axis Labels. Default is true
Gets or sets whether we should display the X Line. Default is true
Gets or sets whether we should display the X Line. Default is true
Gets or sets whether we should display the Y Line. Default is true
Gets or sets whether we should display the Y Line. Default is true
Gets or sets the tooltipDataTemplate, which allows to customize content for the tooltip
Gets or sets the tooltipDataTemplate, which allows to customize content for the tooltip
Gets or sets the tooltip shadow color as an HTML Color code
Gets or sets the tooltip shadow color as an HTML Color code
Applies a theme (defined by IThemeProvider) to the current element
The theme data to apply
Checks execute condition
Checks execute primary and secondary conditions
Deletes native (WebAssembly) memory used by this type, after which it cannot be used.
Gets all series on the parent surface.
Returns all visible and included renderable series. The list also contains included visible stacked renderable series This calls this.testIsIncludedSeries so it is best to customise the including check behaviour there.
Returns the list of included X axes
Returns the list of included Y axes
Checks if event conditions should trigger the modifier action
current event info as ModifierMouseArgs
Returns current mouse position
Grows the Axis by a fraction around the mouse point
the X,Y location of the mouse at the time of the operation
the Axis to grow or shrink
the fraction, e.g. 0.1 grows the axis by 10%
Override hitTestRenderableSeries and add a custom logic here
Includes all X and Y axes
Includes or excludes X axis
Includes or excludes Y axis
Called when the modifier is attached to a parent SciChartSurfaceBase
Called when a RenderableSeries is attached to this modifier
Called when a SciChartSubSurface} is attached to the parent SciChartSurface
Called when the modifier is detached from a parent SciChartSurfaceBase
Called when a RenderableSeries is detached from this modifier
Called when a SciChartSubSurface is detached from the parent SciChartSurface
Called when the parent SciChartSurfaceBase is rendered
Sets the parent SciChartSurfaceBase on this modifier
Convert the object to a definition that can be serialized to JSON, or used directly with the builder api
Generated using TypeDoc
The CursorModifier provides tooltip and cursor behavior on a 2D SciChartSurface within SciChart - High Performance JavaScript Charts
To apply the CursorModifier to a SciChartSurface and add tooltip behavior, use the following code:
const sciChartSurface: SciChartSurface; sciChartSurface.chartModifiers.add(new CursorModifier());📚 Docs: https://www.scichart.com/documentation/js/v4/2d-charts/chart-modifier-api/cursor-modifier/cursor-modifier-overview/