Options
All
  • Public
  • Public/Protected
  • All
Menu

The CursorModifier provides tooltip and cursor behavior on a 2D SciChartSurface within SciChart - High Performance JavaScript Charts

remarks

To apply the CursorModifier to a SciChartSurface and add tooltip behavior, use the following code:

const sciChartSurface: SciChartSurface;
sciChartSurface.chartModifiers.add(new CursorModifier());

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

Protected activePointerEvents

activePointerEvents: Map<number, ModifierMouseArgs> = new Map()

Stores info about active pointerdown events

axisLabelFill

axisLabelFill: string = "#228B22"

Gets or sets both axis label fill as an HTML Color code.

axisLabelStroke

axisLabelStroke: string = "#fff"

Gets or sets both axis label text color as an HTML Color code

Protected changedPropertiesList

changedPropertiesList: string[] = []

crosshairStrokeDashArray

crosshairStrokeDashArray: number[] = []

Gets or sets the crosshair line dash array

Protected crosshairStrokeProperty

crosshairStrokeProperty: string = SciChartSurfaceBase.DEFAULT_THEME.cursorLineBrush

crosshairStrokeThickness

crosshairStrokeThickness: number = 2

Gets or sets the crosshair line strokethickness

Protected executeOnProperty

executeOnProperty: EExecuteOn = EExecuteOn.MouseLeftButton

hitTestRadius

hitTestRadius: number = 0

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

Readonly id

id: string

A unique Id for the IChartModifierBase

Protected includedSeriesMap

includedSeriesMap: Map<IRenderableSeries, boolean> = new Map<IRenderableSeries, boolean>()

invalidateParentCallback

invalidateParentCallback: () => void

A callback to invalidate the parent SciChartSurfaceBase

Type declaration

    • (): void
    • Returns void

Protected isAttachedProperty

isAttachedProperty: boolean

Protected isEnabledProperty

isEnabledProperty: boolean = true

modifierGroup

modifierGroup: string | undefined

Specifies a string ID to group modifiers.

remarks

When one receives a mouse event, all modifiers in the same group receive the event.

Protected mousePoint

mousePoint: Point | undefined

Protected mousePosition

mousePosition: EMousePosition = EMousePosition.OutOfCanvas

Protected parentSurfaceProperty

parentSurfaceProperty: SciChartSurface

Protected placementDivIdProperty

placementDivIdProperty: string | undefined

Protected previousPoint

previousPoint: Point | undefined

Protected receiveHandledEventsProperty

receiveHandledEventsProperty: boolean

Protected showAxisLabelsProperty

showAxisLabelsProperty: boolean = true

showTooltip

showTooltip: boolean = false

Gets or sets whether we should display the tooltip. Default is false

Protected showXLineProperty

showXLineProperty: boolean = true

Protected showYLineProperty

showYLineProperty: boolean = true

Protected tooltipAnnotation

tooltipAnnotation: CursorTooltipSvgAnnotation | undefined

tooltipContainerBackground

tooltipContainerBackground: string = "#228B22"

Gets or sets the tooltip container background color as an HTML Color code

Protected Optional tooltipDataTemplateProperty

tooltipDataTemplateProperty: TCursorTooltipDataTemplate | undefined

tooltipLegendOffsetX

tooltipLegendOffsetX: number = 0

Gets or sets the legend X offset

tooltipLegendOffsetY

tooltipLegendOffsetY: number = 0

Gets or sets the legend Y offset

Optional tooltipLegendTemplate

tooltipLegendTemplate: TCursorTooltipSvgTemplate

Gets or sets the template for the legend

Protected tooltipShadowProperty

tooltipShadowProperty: string = SciChartSurfaceBase.DEFAULT_THEME.shadowEffectColor

Optional tooltipSvgTemplate

tooltipSvgTemplate: TCursorTooltipSvgTemplate = defaultTooltipTemplate

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);

tooltipTextStroke

tooltipTextStroke: string = "#fff"

Gets or sets the tooltip text color as an HTML Color code

Readonly type

type: Cursor = EChart2DModifierType.Cursor

Protected typeMap

typeMap: Map<string, string> = new Map<string, string>()

Protected xAxisIdProperty

xAxisIdProperty: string = AxisCore.DEFAULT_AXIS_ID

xAxisLabelFill

xAxisLabelFill: string | undefined = undefined

Gets or sets the xAxis label fill as an HTML Color code.

xAxisLabelStroke

xAxisLabelStroke: string | undefined = undefined

Gets or sets the xAxis label text color as an HTML Color code

Protected xLineAnnotation

xLineAnnotation: LineAnnotation | undefined

xyDirection

xyDirection: EXyDirection = EXyDirection.XyDirection

Protected yAxisIdProperty

yAxisIdProperty: string = AxisCore.DEFAULT_AXIS_ID

yAxisLabelFill

yAxisLabelFill: string | undefined = undefined

Gets or sets the yAxis label fill as an HTML Color code.

yAxisLabelStroke

yAxisLabelStroke: string | undefined = undefined

Gets or sets the xAxis label text color as an HTML Color code

Protected yLineAnnotation

yLineAnnotation: LineAnnotation | undefined

Accessors

canReceiveMouseEvents

  • get canReceiveMouseEvents(): boolean

crosshairStroke

  • get crosshairStroke(): string
  • set crosshairStroke(value: string): void
  • Gets or sets the crosshair line Stroke color as an HTML Color code

    Returns string

  • Gets or sets the crosshair line Stroke color as an HTML Color code

    Parameters

    • value: string

    Returns void

executeOn

  • The operation that modifier should respond to

    inheritdoc

    Returns EExecuteOn

  • The operation that modifier should respond to

    inheritdoc

    Parameters

    Returns void

isAttached

  • get isAttached(): boolean

isEnabled

  • get isEnabled(): boolean
  • set isEnabled(isEnabled: boolean): void
  • When true, the modifier is enabled

    inheritdoc

    Returns boolean

  • When true, the modifier is enabled

    inheritdoc

    Parameters

    • isEnabled: boolean

    Returns void

modifierType

parentSurface

placementDivId

  • get placementDivId(): string
  • set placementDivId(value: string): void
  • Gets or sets the parent div element reference or id for the Tooltip

    Returns string

  • Gets or sets the parent div element reference or id for the Tooltip

    Parameters

    • value: string

    Returns void

receiveHandledEvents

  • get receiveHandledEvents(): boolean
  • set receiveHandledEvents(receiveHandledEvents: boolean): void
  • When true, this modifier should receive events which have been handled by modifiers higher up in the call hierachy.

    inheritdoc

    Returns boolean

  • When true, this modifier should receive events which have been handled by modifiers higher up in the call hierachy.

    inheritdoc

    Parameters

    • receiveHandledEvents: boolean

    Returns void

showAxisLabels

  • get showAxisLabels(): boolean
  • set showAxisLabels(value: boolean): void
  • Gets or sets whether we should display the Axis Labels. Default is true

    Returns boolean

  • Gets or sets whether we should display the Axis Labels. Default is true

    Parameters

    • value: boolean

    Returns void

showXLine

  • get showXLine(): boolean
  • set showXLine(value: boolean): void
  • Gets or sets whether we should display the X Line. Default is true

    Returns boolean

  • Gets or sets whether we should display the X Line. Default is true

    Parameters

    • value: boolean

    Returns void

showYLine

  • get showYLine(): boolean
  • set showYLine(value: boolean): void
  • Gets or sets whether we should display the Y Line. Default is true

    Returns boolean

  • Gets or sets whether we should display the Y Line. Default is true

    Parameters

    • value: boolean

    Returns void

tooltipDataTemplate

  • Gets or sets the tooltipDataTemplate, which allows to customize content for the tooltip

    Returns TCursorTooltipDataTemplate

  • Gets or sets the tooltipDataTemplate, which allows to customize content for the tooltip

    Parameters

    Returns void

tooltipShadow

  • get tooltipShadow(): string
  • set tooltipShadow(value: string): void
  • Gets or sets the tooltip shadow color as an HTML Color code

    Returns string

  • Gets or sets the tooltip shadow color as an HTML Color code

    Parameters

    • value: string

    Returns void

xAxisId

  • get xAxisId(): string
  • set xAxisId(xAxisId: string): void
  • inheritdoc

    Returns string

  • inheritdoc

    Parameters

    • xAxisId: string

    Returns void

yAxisId

  • get yAxisId(): string
  • set yAxisId(yAxisId: string): void
  • inheritdoc

    Returns string

  • inheritdoc

    Parameters

    • yAxisId: string

    Returns void

Methods

applyTheme

delete

  • delete(): void
  • Deletes native (WebAssembly) memory used by this type, after which it cannot be used.

    remarks

    Call .delete() before finishing with the object to ensure that WebAssmembly memory leaks do not occur.

    All elements within SciChart's High Performance Realtime JavaScript Charts which implement IDeletable must be deleted manually to free native (WebAssembly) memory

    Returns void

Protected getAllSeries

getIncludedRenderableSeries

Protected getIsActionAllowed

getMousePosition

  • Returns current mouse position

    Returns EMousePosition

Protected getSeriesInfos

  • Returns SeriesInfo[]

Protected growBy

  • Grows the Axis by a fraction around the mouse point

    Parameters

    • mousePoint: Point

      the X,Y location of the mouse at the time of the operation

    • axis: AxisBase2D

      the Axis to grow or shrink

    • fraction: number

      the fraction, e.g. 0.1 grows the axis by 10%

    Returns void

hitTestRenderableSeries

  • Override hitTestRenderableSeries and add a custom logic here

    Parameters

    Returns HitTestInfo

includeSeries

Protected isVerticalChart

  • isVerticalChart(): boolean
  • Returns boolean

modifierDoubleClick

modifierDrop

modifierMouseDown

modifierMouseEnter

modifierMouseLeave

modifierMouseMove

modifierMouseUp

modifierMouseWheel

modifierPointerCancel

Protected newLineAnnotation

  • newLineAnnotation(axisLabelFill: string, axisLabelStroke: string): LineAnnotation
  • Parameters

    • axisLabelFill: string
    • axisLabelStroke: string

    Returns LineAnnotation

Protected notifyPropertyChanged

  • notifyPropertyChanged(propertyName: string): void

onAttach

  • onAttach(): void

onAttachSeries

onAttachSubSurface

onDetach

  • onDetach(): void

onDetachSeries

onDetachSubSurface

onParentSurfaceRendered

  • onParentSurfaceRendered(): void

setParentSurface

Protected testPropertyChanged

  • testPropertyChanged(propertyName: string): boolean

toJSON

  • toJSON(): { options: {}; type: string }
  • Convert the object to a definition that can be serialized to JSON, or used directly with the builder api

    Returns { options: {}; type: string }

    • options: {}
    • type: string

Protected update

  • update(): void
  • Returns void

Protected updatePointerInfo

Generated using TypeDoc