Options
All
  • Public
  • Public/Protected
  • All
Menu
summary

The ChannelAnnotation provides a multi-point annotation which draws a parallel price channel over the {@link SciChartSurface}.

description

To add a ChannelAnnotation to a {@link SciChartSurface}, use the following code:

const sciChartSurface: SciChartSurface;
const channelAnnotation = new ChannelAnnotation({
    points: [
         new Point(0, 5),  // can also be written as "{ x: 0, y: 5 }"
         new Point(10, 7),
         new Point(10, 3)
    ],
    stroke: "#3B82F6",
    strokeThickness: 2,
    strokeDashArray: [4, 2],
    midLineStrokeDashArray: [4, 3],
    showMidLine: true,
    showMidPointGrips: true,
    fill: "#3B82F633"
});
sciChartSurface.annotations.add(channelAnnotation);

The first two points define one channel line; the third controls the offset.

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Object literals

Constructors

constructor

Properties

Protected activeDragPoint

activeDragPoint: IDragPoint | undefined

Protected adornerClippingProperty

adornerClippingProperty: EAnnotationClippingMode | string = EAnnotationClippingMode.Chart

Protected adornerDraggingPointProperty

adornerDraggingPointProperty: EDraggingGripPoint

Protected adornerVisibilityProperty

adornerVisibilityProperty: EAnnotationVisibilityMode = EAnnotationVisibilityMode.OnInteraction

Protected annotationsGripsFillProperty

annotationsGripsFillProperty: string = SciChartSurfaceBase.DEFAULT_THEME.annotationsGripsBackgroundBrush

Protected annotationsGripsRadiusProperty

annotationsGripsRadiusProperty: number = ADORNER_GRIP_RADIUS

Protected annotationsGripsStrokeProperty

annotationsGripsStrokeProperty: string = SciChartSurfaceBase.DEFAULT_THEME.annotationsGripsBorderBrush

Protected axisLabelCornerRadiusProperty

axisLabelCornerRadiusProperty: number = 2

Protected axisLabelFillProperty

axisLabelFillProperty: string | undefined

Protected axisLabelPaddingProperty

axisLabelPaddingProperty: Thickness = new Thickness(2, 4, 2, 4)

Protected axisLabelStrokeProperty

axisLabelStrokeProperty: string | undefined

Protected axisLabelVisibilityProperty

axisLabelVisibilityProperty: EAnnotationVisibilityMode = EAnnotationVisibilityMode.OnInteraction

Protected axisSpanFillOpacityProperty

axisSpanFillOpacityProperty: number = 0.2

clicked

clicked: EventHandler<AnnotationClickEventArgs>

Protected clippingProperty

clippingProperty: EAnnotationClippingMode | string = EAnnotationClippingMode.SeriesViewRect

dragDelta

dragDelta: EventHandler<AnnotationDragDeltaEventArgs>

dragEnded

dragEnded: EventHandler<void>

Protected dragPointDefinitions

dragPointDefinitions: IDragPoint[] = []

Protected dragPointsProperty

dragPointsProperty: keyof EDraggingGripPoint[] = [EDraggingGripPoint.Body,EDraggingGripPoint.x1y1,EDraggingGripPoint.x2y2,EDraggingGripPoint.x2y1,EDraggingGripPoint.x1y2]

dragStarted

dragStarted: EventHandler<void>

Protected draggingCursorProperty

draggingCursorProperty: ECursorStyle = ECursorStyle.Grabbing

Protected gripSvgTemplateProperty

gripSvgTemplateProperty: TAnnotationGripSvgTemplate | undefined

Protected gripVisibilityProperty

gripVisibilityProperty: EAnnotationVisibilityMode = EAnnotationVisibilityMode.OnInteraction

Protected hasAppliedSnapToDataPointOnInit

hasAppliedSnapToDataPointOnInit: boolean = false

Protected hoverCursorProperty

hoverCursorProperty: ECursorStyle = ECursorStyle.Pointer

hovered

hovered: EventHandler<AnnotationHoverEventArgs>

Readonly id

id: string
inheritdoc

Protected idleCursorProperty

idleCursorProperty: ECursorStyle = ECursorStyle.Crosshair

invalidateParentCallback

invalidateParentCallback: (options?: { force?: boolean; svgOnly?: boolean }) => void
inheritdoc

Type declaration

    • (options?: { force?: boolean; svgOnly?: boolean }): void
    • Parameters

      • Optional options: { force?: boolean; svgOnly?: boolean }
        • Optional force?: boolean
        • Optional svgOnly?: boolean

      Returns void

Protected invalidateState

invalidateState: { isHidden: boolean; x1: number; y1: number }

Type declaration

  • isHidden: boolean
  • x1: number
  • y1: number

Readonly isDomAnnotation

isDomAnnotation: boolean = false

Protected isHiddenProperty

isHiddenProperty: boolean = false

Readonly isSvgAnnotation

isSvgAnnotation: boolean = false
inheritdoc

Protected labelsProperty

labelsProperty: IMultiPointLabelDefinition[] = []

Protected lastDragMousePoint

lastDragMousePoint: Point | undefined

Protected multiPointLabelFormatterProperty

multiPointLabelFormatterProperty: TMultiPointLabelFormatter | undefined

Protected multiPointLabelStyleFormatterProperty

multiPointLabelStyleFormatterProperty: TMultiPointLabelStyleFormatter | undefined

Protected parentAnnotationIdProperty

parentAnnotationIdProperty: string | null = null

Protected parentSurfaceProperty

parentSurfaceProperty: SciChartSurfaceBase

Protected pointLabelVisibilityProperty

pointLabelVisibilityProperty: EAnnotationVisibilityMode = EAnnotationVisibilityMode.Always

Protected pointsProperty

pointsProperty: Point[] = []

Protected prevIsSelected

prevIsSelected: boolean = true

Protected prevValue

prevValue: { x: number; y: number }

Type declaration

  • x: number
  • y: number

Protected renderLayerProperty

renderLayerProperty: EDefaultRenderLayer | number

Protected renderNextToProperty

renderNextToProperty: { offset: number; renderable: IOrderedRenderable | string }

Type declaration

  • offset: number
  • renderable: IOrderedRenderable | string

Protected renderOrderProperty

renderOrderProperty: number = undefined

Protected segmentLabelVisibilityProperty

segmentLabelVisibilityProperty: EAnnotationVisibilityMode = EAnnotationVisibilityMode.Always

selectedChanged

selectedChanged: EventHandler<boolean>

Protected selectionBoxDeltaProperty

selectionBoxDeltaProperty: number = 1.5

Protected selectionBoxStrokeProperty

selectionBoxStrokeProperty: string = SciChartSurfaceBase.DEFAULT_THEME.annotationSelectionStroke

Protected selectionBoxThicknessProperty

selectionBoxThicknessProperty: number = 6

Protected snapModeProperty

snapModeProperty: ESnapMode = ESnapMode.None

Protected snapToDataPointOnInitProperty

snapToDataPointOnInitProperty: boolean = false

Protected snapToDataPointRadiusProperty

snapToDataPointRadiusProperty: number = 10

Protected snapToSeriesIdProperty

snapToSeriesIdProperty: string | undefined

Protected surfaceRenderOrderProperty

surfaceRenderOrderProperty: number = undefined

Readonly surfaceTypes

surfaceTypes: ESurfaceType[] = [ESurfaceType.SciChartSurfaceType,ESurfaceType.SciChartPolarSurfaceType]
inheritdoc

Protected svgAdorner

svgAdorner: SVGElement

Readonly type

type: EAnnotationType = asCoreAnnotationType(ETradingAnnotationType.ChannelAnnotation)
inheritdoc

Protected typeMap

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

Protected x1Property

x1Property: number

Protected xCoordinateModeProperty

xCoordinateModeProperty: ECoordinateMode = ECoordinateMode.DataValue

Protected y1Property

y1Property: number

Protected yCoordinateModeProperty

yCoordinateModeProperty: ECoordinateMode = ECoordinateMode.DataValue

Accessors

adornerClipping

  • get adornerClipping(): string
  • set adornerClipping(value: EAnnotationClippingMode | string): void
  • Gets or sets mode or custom rule for adorners clipping

    Returns string

  • Gets or sets mode or custom rule for adorners clipping

    Parameters

    • value: EAnnotationClippingMode | string

    Returns void

adornerDraggingPoint

  • get adornerDraggingPoint(): EDraggingGripPoint
  • set adornerDraggingPoint(value: EDraggingGripPoint): void

adornerVisibility

annotationLayer

  • get annotationLayer(): EAnnotationLayer
  • set annotationLayer(annotationCanvas: EAnnotationLayer): void

annotationsGripsFill

  • get annotationsGripsFill(): string
  • set annotationsGripsFill(color: string): void
  • Multi-point grips default to the current theme background unless explicitly overridden.

    Returns string

  • Multi-point grips default to the current theme background unless explicitly overridden.

    Parameters

    • color: string

    Returns void

annotationsGripsRadius

  • get annotationsGripsRadius(): number
  • set annotationsGripsRadius(radius: number): void

annotationsGripsStroke

  • get annotationsGripsStroke(): string
  • set annotationsGripsStroke(color: string): void
  • Gets or sets the grip stroke color.

    Returns string

  • Gets or sets the grip stroke color.

    Parameters

    • color: string

    Returns void

axisLabelCornerRadius

  • get axisLabelCornerRadius(): number
  • set axisLabelCornerRadius(value: number): void
  • Gets or sets axis-label corner radius for labels with anchorMode: Axis.

    Returns number

  • Gets or sets axis-label corner radius for labels with anchorMode: Axis.

    Parameters

    • value: number

    Returns void

axisLabelFill

  • get axisLabelFill(): string | undefined
  • set axisLabelFill(value: string | undefined): void
  • Gets or sets axis-label fill for labels with anchorMode: Axis.

    Returns string | undefined

  • Gets or sets axis-label fill for labels with anchorMode: Axis.

    Parameters

    • value: string | undefined

    Returns void

axisLabelPadding

  • get axisLabelPadding(): Thickness
  • set axisLabelPadding(value: Thickness): void
  • Gets or sets axis-label padding for labels with anchorMode: Axis.

    Returns Thickness

  • Gets or sets axis-label padding for labels with anchorMode: Axis.

    Parameters

    • value: Thickness

    Returns void

axisLabelStroke

  • get axisLabelStroke(): string
  • set axisLabelStroke(value: string): void
  • Gets or sets axis-label text color for labels with anchorMode: Axis.

    Returns string

  • Gets or sets axis-label text color for labels with anchorMode: Axis.

    Parameters

    • value: string

    Returns void

axisLabelVisibility

axisSpanFillOpacity

  • get axisSpanFillOpacity(): number
  • set axisSpanFillOpacity(value: number): void
  • Gets or sets span opacity between adjacent axis labels for labels with anchorMode: Axis.

    Returns number

  • Gets or sets span opacity between adjacent axis labels for labels with anchorMode: Axis.

    Parameters

    • value: number

    Returns void

clipping

  • get clipping(): string
  • set clipping(value: EAnnotationClippingMode | string): void
  • Gets or sets mode or custom rule for clipping

    Returns string

  • Gets or sets mode or custom rule for clipping

    Parameters

    • value: EAnnotationClippingMode | string

    Returns void

defaultBackgroundColor

  • get defaultBackgroundColor(): string

defaultForegroundColor

  • get defaultForegroundColor(): string

dragPoints

  • get dragPoints(): keyof EDraggingGripPoint[]
  • set dragPoints(dragPoints: keyof EDraggingGripPoint[]): void
  • Get the dragging points that should be enabled for this annotation

    Returns keyof EDraggingGripPoint[]

  • Set the dragging points that should be enabled for this annotation

    Parameters

    • dragPoints: keyof EDraggingGripPoint[]

    Returns void

draggingCursor

  • get draggingCursor(): ECursorStyle
  • set draggingCursor(value: ECursorStyle): void
  • Gets or sets dragging cursor.

    Returns ECursorStyle

  • Gets or sets dragging cursor.

    Parameters

    • value: ECursorStyle

    Returns void

fill

  • get fill(): string | null
  • set fill(value: string | null): void
  • Gets or sets channel fill color.

    Returns string | null

  • Gets or sets channel fill color.

    Parameters

    • value: string | null

    Returns void

formatLabel

formatLabelStyle

gripSvgTemplate

  • get gripSvgTemplate(): TAnnotationGripSvgTemplate | undefined
  • set gripSvgTemplate(value: TAnnotationGripSvgTemplate | undefined): void

gripVisibility

hoverCursor

  • get hoverCursor(): ECursorStyle
  • set hoverCursor(value: ECursorStyle): void
  • Gets or sets hover cursor.

    Returns ECursorStyle

  • Gets or sets hover cursor.

    Parameters

    • value: ECursorStyle

    Returns void

idleCursor

  • get idleCursor(): ECursorStyle
  • set idleCursor(value: ECursorStyle): void
  • Gets or sets idle cursor.

    Returns ECursorStyle

  • Gets or sets idle cursor.

    Parameters

    • value: ECursorStyle

    Returns void

isDraggingStarted

  • get isDraggingStarted(): boolean

isEditable

  • get isEditable(): boolean
  • set isEditable(isEditable: boolean): void
  • Editing flag toggled during placement workflow.

    inheritdoc

    Returns boolean

  • Editing flag toggled during placement workflow.

    inheritdoc

    Parameters

    • isEditable: boolean

    Returns void

isHidden

  • get isHidden(): boolean
  • set isHidden(isHidden: boolean): void

isHovered

  • get isHovered(): boolean
  • set isHovered(value: boolean): void

isSelected

  • get isSelected(): boolean
  • set isSelected(value: boolean): void
  • Selection state used to keep adorner visible while placing.

    inheritdoc

    Returns boolean

  • Selection state used to keep adorner visible while placing.

    inheritdoc

    Parameters

    • value: boolean

    Returns void

isVerticalChart

  • get isVerticalChart(): boolean

isVisible

  • get isVisible(): boolean
  • set isVisible(value: boolean): void

labels

midLineStrokeDashArray

  • get midLineStrokeDashArray(): number[] | undefined
  • set midLineStrokeDashArray(value: number[] | undefined): void
  • Gets or sets the middle line dash array. undefined means solid line.

    Returns number[] | undefined

  • Gets or sets the middle line dash array. undefined means solid line.

    Parameters

    • value: number[] | undefined

    Returns void

opacity

  • get opacity(): number
  • set opacity(opacity: number): void

parentAnnotationId

  • get parentAnnotationId(): string | null
  • set parentAnnotationId(value: string | null): void

parentSurface

  • get parentSurface(): SciChartSurface
  • set parentSurface(parentSurface: SciChartSurface): void
  • inheritdoc

    Returns SciChartSurface

  • inheritdoc

    Parameters

    • parentSurface: SciChartSurface

    Returns void

pointLabelVisibility

points

  • get points(): Point[]
  • set points(value: Point[]): void
  • Gets or sets points.

    Returns Point[]

  • Gets or sets points.

    Parameters

    • value: Point[]

    Returns void

resizeDirections

  • get resizeDirections(): EXyDirection
  • set resizeDirections(value: EXyDirection): void

segmentLabelVisibility

selectionBoxDelta

  • get selectionBoxDelta(): number
  • set selectionBoxDelta(delta: number): void

selectionBoxStroke

  • get selectionBoxStroke(): string
  • set selectionBoxStroke(color: string): void

selectionBoxThickness

  • get selectionBoxThickness(): number
  • set selectionBoxThickness(delta: number): void

showMidLine

  • get showMidLine(): boolean
  • set showMidLine(value: boolean): void
  • Gets or sets visibility of middle line.

    Returns boolean

  • Gets or sets visibility of middle line.

    Parameters

    • value: boolean

    Returns void

showMidPointGrips

  • get showMidPointGrips(): boolean
  • set showMidPointGrips(value: boolean): void
  • Gets or sets visibility of midpoint grips on top/bottom edges.

    Returns boolean

  • Gets or sets visibility of midpoint grips on top/bottom edges.

    Parameters

    • value: boolean

    Returns void

snapMode

snapToDataPoint

  • get snapToDataPoint(): boolean
  • set snapToDataPoint(value: boolean): void
  • Backward-compatible snap toggle.

    Returns boolean

  • Backward-compatible snap toggle.

    Parameters

    • value: boolean

    Returns void

snapToDataPointOnInit

  • get snapToDataPointOnInit(): boolean
  • set snapToDataPointOnInit(value: boolean): void

snapToDataPointRadius

  • get snapToDataPointRadius(): number
  • set snapToDataPointRadius(value: number): void

snapToSeriesId

  • get snapToSeriesId(): string | undefined
  • set snapToSeriesId(value: string | undefined): void
  • Gets or sets target snap series id.

    Returns string | undefined

  • Gets or sets target snap series id.

    Parameters

    • value: string | undefined

    Returns void

stroke

  • get stroke(): string
  • set stroke(value: string): void
  • Gets or sets stroke color.

    Returns string

  • Gets or sets stroke color.

    Parameters

    • value: string

    Returns void

strokeDashArray

  • get strokeDashArray(): number[]
  • set strokeDashArray(value: number[]): void
  • Gets or sets dash array for top and bottom lines.

    Returns number[]

  • Gets or sets dash array for top and bottom lines.

    Parameters

    • value: number[]

    Returns void

strokeThickness

  • get strokeThickness(): number
  • set strokeThickness(value: number): void
  • Gets or sets stroke thickness.

    Returns number

  • Gets or sets stroke thickness.

    Parameters

    • value: number

    Returns void

Protected svgAdornerRoot

  • get svgAdornerRoot(): SVGSVGElement

x1

  • get x1(): number
  • set x1(x1: number): void
  • inheritdoc

    Returns number

  • inheritdoc

    Parameters

    • x1: number

    Returns void

x2

  • get x2(): number
  • set x2(x2: number): void
  • inheritdoc

    Returns number

  • inheritdoc

    Parameters

    • x2: number

    Returns void

xAxis

  • get xAxis(): AxisBase2D | undefined
  • inheritdoc

    Returns AxisBase2D | undefined

xAxisId

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

    Returns string | undefined

  • inheritdoc

    Parameters

    • xAxisId: string

    Returns void

xCoordinateMode

  • get xCoordinateMode(): ECoordinateMode
  • set xCoordinateMode(xCoordinateMode: ECoordinateMode): void

y1

  • get y1(): number
  • set y1(y1: number): void
  • inheritdoc

    Returns number

  • inheritdoc

    Parameters

    • y1: number

    Returns void

y2

  • get y2(): number
  • set y2(y2: number): void
  • inheritdoc

    Returns number

  • inheritdoc

    Parameters

    • y2: number

    Returns void

yAxis

  • get yAxis(): AxisBase2D | undefined
  • inheritdoc

    Returns AxisBase2D | undefined

yAxisId

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

    Returns string | undefined

  • inheritdoc

    Parameters

    • yAxisId: string

    Returns void

yCoordinateMode

  • get yCoordinateMode(): ECoordinateMode
  • set yCoordinateMode(yCoordinateMode: ECoordinateMode): void

Methods

Protected applyPixelRatioToDragDist

  • applyPixelRatioToDragDist(dist: number): number

Protected applySvgClipping

  • applySvgClipping(svgString: string, clipping: EAnnotationClippingMode | string): string
  • Parameters

    • svgString: string
    • clipping: EAnnotationClippingMode | string

    Returns string

calcDragDistance

  • calcDragDistance(xyValues: Point): void
  • inheritdoc

    Parameters

    • xyValues: Point

    Returns void

canDragBody

  • canDragBody(): boolean

canDragPoint

  • canDragPoint(dragPoint: EDraggingGripPoint): boolean
  • Override this to disable drag behaviour for certain dragging points

    Parameters

    • dragPoint: EDraggingGripPoint

    Returns boolean

checkIsClickedOnAnnotation

  • checkIsClickedOnAnnotation(x: number, y: number): boolean

Protected checkIsClickedOnAnnotationInternal

  • checkIsClickedOnAnnotationInternal(x: number, y: number): boolean

checkIsPointWithinClipArea

  • checkIsPointWithinClipArea(mousePoint: Point): boolean

checkIsWithinBounds

  • checkIsWithinBounds(args: ModifierMouseArgs): boolean
  • Calculates if the annotation is hovered with the specified args

    Parameters

    • args: ModifierMouseArgs

    Returns boolean

Protected clamp01

  • clamp01(value: number): number
  • Clamps a number into [0..1].

    Parameters

    • value: number

    Returns number

click

  • click(args: ModifierMouseArgs, selectOnClick: boolean): boolean
  • Called internally. Send a click to the annotation if the point is in bounds, raising the clicked event and optionally selecting the annotation.

    Parameters

    • args: ModifierMouseArgs
    • selectOnClick: boolean

    Returns boolean

clickToSelect

  • clickToSelect(args: ModifierMouseArgs): boolean
  • Called internally. Select the annotation if the point is in bounds. Does not raise the clicked event

    Parameters

    • args: ModifierMouseArgs

    Returns boolean

Protected clonePoints

  • clonePoints(points: Point[] | undefined): Point[]
  • Returns a cloned point array.

    Parameters

    • points: Point[] | undefined

    Returns Point[]

Protected convertCartesianToPolar

  • convertCartesianToPolar(x: number, y: number): { x: number; y: number }
  • For Polar surface converts Cartesian Coordinates to Polar, otherwise returns the original values

    Parameters

    • x: number
    • y: number

    Returns { x: number; y: number }

    • x: number
    • y: number

Protected convertFromCoordinate

  • convertFromCoordinate(value: number, calculator: CoordinateCalculatorBase, coordinateMode: ECoordinateMode): number
  • Converts an absolute coordinate to a value which could be in form of DataValue, Pixel, or Relative coordinate

    Parameters

    • value: number

      an absolute coordinate to convert

    • calculator: CoordinateCalculatorBase

      the {@link CoordinateCalculatorBase} which will do the transformation

    • coordinateMode: ECoordinateMode

      the expected {@link ECoordinateMode} of the converted point

    Returns number

    the data-value, pixel, or relative value accordingly to the coordinateMode

Protected convertPolarToCartesian

  • convertPolarToCartesian(x: number, y: number, isDomAnnotation?: boolean): { x: number; y: number }
  • For Polar surface converts Polar Coordinates to Cartesian, otherwise returns the original values

    Parameters

    • x: number

      is always angle for Polar

    • y: number

      is always radius for Polar

    • Default value isDomAnnotation: boolean = false

    Returns { x: number; y: number }

    • x: number
    • y: number

Protected copyThickness

  • copyThickness(value: Thickness): Thickness
  • Clones a thickness value.

    Parameters

    • value: Thickness

    Returns Thickness

delete

  • delete(): void
  • inheritdoc

    Returns void

Protected deleteAdorner

  • deleteAdorner(): void

Protected drawAxisAnchoredLabels

  • drawAxisAnchoredLabels(renderContext: IRenderContext2D, labelCoords: number[], defaultFill?: string, axes?: AxisBase2D[]): void
  • Draws axis labels + spans for explicit axis coordinates in series-view-rect pixels.

    Parameters

    • renderContext: IRenderContext2D
    • labelCoords: number[]
    • Optional defaultFill: string
    • Default value axes: AxisBase2D[] = this.getVirtualYAxes()

    Returns void

Protected drawAxisAnchoredLabelsFromDefinitions

  • drawAxisAnchoredLabelsFromDefinitions(renderContext: IRenderContext2D, xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase, defaultFill?: string): void
  • Draws axis labels + spans for labels with anchorMode: Axis.

    Parameters

    • renderContext: IRenderContext2D
    • xCalc: CoordinateCalculatorBase
    • yCalc: CoordinateCalculatorBase
    • Optional defaultFill: string

    Returns void

Protected drawPointAndSegmentLabels

  • drawPointAndSegmentLabels(renderContext: IRenderContext2D, xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): void
  • Draws point/segment labels via the texture text rendering path.

    Parameters

    • renderContext: IRenderContext2D
    • xCalc: CoordinateCalculatorBase
    • yCalc: CoordinateCalculatorBase

    Returns void

Protected drawQuad

  • drawQuad(renderContext: IRenderContext2D, quad: TQuad, seriesViewRect: Rect, clipRect: Rect, fillBrush: IBrush2D): void
  • Parameters

    • renderContext: IRenderContext2D
    • quad: TQuad
    • seriesViewRect: Rect
    • clipRect: Rect
    • fillBrush: IBrush2D

    Returns void

drawWithContext

  • drawWithContext(renderContext: IRenderContext2D, xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase, seriesViewRect: Rect, surfaceViewRect: Rect, chartViewRect: Rect): void
  • inheritdoc

    Parameters

    • renderContext: IRenderContext2D
    • xCalc: CoordinateCalculatorBase
    • yCalc: CoordinateCalculatorBase
    • seriesViewRect: Rect
    • surfaceViewRect: Rect
    • chartViewRect: Rect

    Returns void

Protected ensureBrushCache

  • ensureBrushCache(cache: BrushCache | undefined): BrushCache | undefined
  • Ensures a brush cache exists for the current surface.

    Parameters

    • cache: BrushCache | undefined

    Returns BrushCache | undefined

Protected ensurePenCache

  • ensurePenCache(cache: Pen2DCache | undefined): Pen2DCache | undefined
  • Ensures a pen cache exists for the current surface.

    Parameters

    • cache: Pen2DCache | undefined

    Returns Pen2DCache | undefined

Protected getAbsoluteCoordinates

  • getAbsoluteCoordinates(point: Point): Point

Protected getAbsoluteHorizontalCoordinate

  • getAbsoluteHorizontalCoordinate(value: number): number

Protected getAbsoluteVerticalCoordinate

  • getAbsoluteVerticalCoordinate(value: number): number

getAdornerAnnotationBorders

  • getAdornerAnnotationBorders(ordered?: boolean, applyDelta?: boolean): { x1: number; x2: number; y1: number; y2: number }
  • Returns annotation borders for the {@link AdornerLayer} which has the size of the whole canvas

    Parameters

    • Default value ordered: boolean = false

      flag to return x and y values in ascending order

    • Default value applyDelta: boolean = false

    Returns { x1: number; x2: number; y1: number; y2: number }

    • x1: number
    • x2: number
    • y1: number
    • y2: number

getAnnotationBorders

  • getAnnotationBorders(ordered?: boolean, applyDelta?: boolean): { x1: number; x2: number; y1: number; y2: number }
  • Returns annotationBorders

    Parameters

    • Default value ordered: boolean = false

      flag to return x and y values in ascending order, where x1 <= x2 and y1 <= y2

    • Default value applyDelta: boolean = false

    Returns { x1: number; x2: number; y1: number; y2: number }

    • x1: number
    • x2: number
    • y1: number
    • y2: number

getAnnotationGripSvg

  • getAnnotationGripSvg(x: number, y: number): string
  • Trading annotations have a more modern default grip SVG

    Parameters

    • x: number
    • y: number

    Returns string

Protected getClipOverscan

  • getClipOverscan(strokeThickness: number): number
  • Returns a DPI-adjusted overscan amount for geometry that will still be rendered with the real clip rect.

    Parameters

    • strokeThickness: number

    Returns number

Protected getClipPath

  • getClipPath(clipping: EAnnotationClippingMode | string): string
  • Parameters

    • clipping: EAnnotationClippingMode | string

    Returns string

getClippingRect

  • getClippingRect(clipping: string | EAnnotationClippingMode, seriesViewRect: Rect, surfaceViewRect: Rect, chartViewRect: Rect): Rect
  • Parameters

    • clipping: string | EAnnotationClippingMode
    • seriesViewRect: Rect
    • surfaceViewRect: Rect
    • chartViewRect: Rect

    Returns Rect

Protected getCoordinate

  • getCoordinate(value: number, calculator: CoordinateCalculatorBase, coordinateMode: ECoordinateMode): number
  • Converts a value (e.g. from x1, x2, y1 or y2) into a pixel coordinate

    Parameters

    • value: number

      the value to convert

    • calculator: CoordinateCalculatorBase

      the {@link CoordinateCalculatorBase} which will do the transformation

    • coordinateMode: ECoordinateMode

      the {@link ECoordinateMode} to apply

    Returns number

    the pixel coordinate

getGripSvg

  • getGripSvg(index: number): string

getInteractionHandles

Protected getPixelPointFromValue

  • getPixelPointFromValue(valuePoint: Point | undefined, xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): Point | undefined
  • Converts one value-space point to series-view-rect pixel coordinates.

    Parameters

    • valuePoint: Point | undefined
    • xCalc: CoordinateCalculatorBase
    • yCalc: CoordinateCalculatorBase

    Returns Point | undefined

Protected getPixelPoints

  • getPixelPoints(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): Point[]
  • Returns points converted to series-view-rect pixel coordinates.

    Parameters

    • xCalc: CoordinateCalculatorBase
    • yCalc: CoordinateCalculatorBase

    Returns Point[]

getPlacementPointCount

  • getPlacementPointCount(): number

Protected getPlacementPointCountInternal

  • getPlacementPointCountInternal(): number

getPointScreenPosition

  • getPointScreenPosition(index: number): Point | undefined

getPointValue

  • getPointValue(index: number): Point | undefined

getRenderLayer

  • getRenderLayer(): number
  • The render layer grouping within which the annotation will be draw. Defaults to EDefaultRenderLayer.AnnotationsAboveSeriesLayer

    Returns number

getRenderNextTo

  • getRenderNextTo(): { offset: number; renderable: IOrderedRenderable | string }
  • Returns { offset: number; renderable: IOrderedRenderable | string }

    • offset: number
    • renderable: IOrderedRenderable | string

getRenderOrder

  • getRenderOrder(): number

Protected getResolvedCoordinate

  • getResolvedCoordinate(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase, x: number, y: number, getX: boolean): number
  • Returns the pixel coordinate depending whether the chart is vertical

    Parameters

    • xCalc: CoordinateCalculatorBase

      the X {@link CoordinateCalculatorBase} which will do the transformation

    • yCalc: CoordinateCalculatorBase

      the Y {@link CoordinateCalculatorBase} which will do the transformation

    • x: number

      the x value

    • y: number

      the y value

    • getX: boolean

      true to return the x coordinate. false for y.

    Returns number

    the pixel coordinate

Protected getSnapSeries

  • getSnapSeries(): IRenderableSeries | undefined
  • Returns the target renderable series for snapping.

    Returns IRenderableSeries | undefined

getSurfaceRenderOrder

  • getSurfaceRenderOrder(): number
  • Allows an annotation to be treated as if it was drawn on a surface with a different draw order than its actual parent surface

    Returns number

Protected getValue

  • getValue(value: number, calculator: CoordinateCalculatorBase, coordinateMode: ECoordinateMode): number
  • Converts a pixel coordinate back to a value

    Parameters

    • value: number

      coordinate or dataValue to convert

    • calculator: CoordinateCalculatorBase

      the {@link CoordinateCalculatorBase} which will do the transformation

    • coordinateMode: ECoordinateMode

      the {@link ECoordinateMode} to apply

    Returns number

    the data-value or value

getValueFromMousePoint

  • getValueFromMousePoint(mousePoint: Point): Point | undefined

Protected getValuesFromCoordinates

  • getValuesFromCoordinates(point: Point, translateToSeriesViewRect: boolean): Point
  • Transforms an absolute coordinates point to the corresponding value point. The value point has x and y converted accordingly to the the coordinate modes xCoordinateMode and yCoordinateMode

    Parameters

    • point: Point
    • translateToSeriesViewRect: boolean

      defines if the coordinates should be projected from the Canvas to SeriesViewRect

    Returns Point

    a point with coordinates {@link ECoordinateMode}

Protected getVirtualXAxes

  • getVirtualXAxes(): AxisBase2D[]

Protected getVirtualYAxes

  • getVirtualYAxes(): AxisBase2D[]

Protected getX1Coordinate

  • getX1Coordinate(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): number
  • Returns the pixel X1 coordinate

    Parameters

    • xCalc: CoordinateCalculatorBase

      the X {@link CoordinateCalculatorBase} which will do the transformation

    • yCalc: CoordinateCalculatorBase

      the Y {@link CoordinateCalculatorBase} which will do the transformation

    Returns number

    the pixel X1 coordinate

Protected getX2Coordinate

  • getX2Coordinate(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): number
  • Returns the pixel X2 coordinate

    Parameters

    • xCalc: CoordinateCalculatorBase

      the X {@link CoordinateCalculatorBase} which will do the transformation

    • yCalc: CoordinateCalculatorBase

      the Y {@link CoordinateCalculatorBase} which will do the transformation

    Returns number

    the pixel X2 coordinate

Protected getXYCoordinatesFromValues

  • getXYCoordinatesFromValues(xyDataPoint: Point): Point

Protected getY1Coordinate

  • getY1Coordinate(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): number
  • Returns the pixel Y1 coordinate

    Parameters

    • xCalc: CoordinateCalculatorBase

      the X {@link CoordinateCalculatorBase} which will do the transformation

    • yCalc: CoordinateCalculatorBase

      the Y {@link CoordinateCalculatorBase} which will do the transformation

    Returns number

    the pixel Y1 coordinate

Protected getY2Coordinate

  • getY2Coordinate(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): number
  • Returns the pixel Y2 coordinate

    Parameters

    • xCalc: CoordinateCalculatorBase

      the X {@link CoordinateCalculatorBase} which will do the transformation

    • yCalc: CoordinateCalculatorBase

      the Y {@link CoordinateCalculatorBase} which will do the transformation

    Returns number

    the pixel Y2 coordinate

hitTestBody

  • hitTestBody(mousePoint: Point): boolean

Protected hitTestRenderableSeries

  • hitTestRenderableSeries(rs: IRenderableSeries, mousePoint: Point): HitTestInfo
  • Hit-tests renderable series for snapping.

    Parameters

    • rs: IRenderableSeries
    • mousePoint: Point

    Returns HitTestInfo

hover

  • hover(options: IHoverOptions): void
  • Sends hover/leave action to the annotation

    Parameters

    • options: IHoverOptions

    Returns void

Protected inflateClipRect

  • inflateClipRect(rect: Rect, padding: number): Rect
  • Inflates a local clip rect so pre-clipped geometry can extend just beyond the rendered clip.

    Parameters

    • rect: Rect
    • padding: number

    Returns Rect

Protected isBodyDragAllowed

  • isBodyDragAllowed(): boolean
  • Returns whether body drag is currently allowed.

    Returns boolean

linkAxes

  • linkAxes(): void

Protected normalizeChannelPoints

  • normalizeChannelPoints(points: Point[] | undefined): Point[]
  • Parameters

    • points: Point[] | undefined

    Returns Point[]

Protected normalizePoints

  • normalizePoints(points: Point[] | undefined, maxCount?: number): Point[]
  • Sanitizes and clones points, optionally capping count.

    Parameters

    • points: Point[] | undefined
    • Optional maxCount: number

    Returns Point[]

Protected notifyPropertyChanged

  • notifyPropertyChanged(propertyName: string): void

onAttach

  • onAttach(scs: SciChartSurface): void
  • inheritdoc

    Parameters

    • scs: SciChartSurface

    Returns void

onDetach

  • onDetach(): void
  • inheritdoc

    Returns void

onDpiChanged

  • onDpiChanged(args: TDpiChangedEventArgs): void
  • inheritdoc

    Parameters

    • args: TDpiChangedEventArgs

    Returns void

onDragAdorner

  • onDragAdorner(args: ModifierMouseArgs): void
  • inheritdoc

    Parameters

    • args: ModifierMouseArgs

    Returns void

onDragEnded

  • onDragEnded(): void
  • inheritdoc

    Returns void

onDragStarted

  • onDragStarted(args: ModifierMouseArgs): boolean
  • inheritdoc

    Parameters

    • args: ModifierMouseArgs

    Returns boolean

Protected resizeBrushCacheCollection

  • resizeBrushCacheCollection(caches: BrushCache[], count: number): void
  • Resizes a brush-cache collection to the required count.

    Parameters

    • caches: BrushCache[]
    • count: number

    Returns void

Protected resizePenCacheCollection

  • resizePenCacheCollection(caches: Pen2DCache[], count: number): void
  • Resizes a pen-cache collection to the required count.

    Parameters

    • caches: Pen2DCache[]
    • count: number

    Returns void

Protected resolveAxisLabelCoordGroups

Protected resolveAxisLabelCoords

  • resolveAxisLabelCoords(xCalc: CoordinateCalculatorBase, yCalc: CoordinateCalculatorBase): number[]
  • Resolves axis coordinates for labels with anchorMode: Axis in series-view-rect pixels.

    Parameters

    • xCalc: CoordinateCalculatorBase
    • yCalc: CoordinateCalculatorBase

    Returns number[]

Protected resolveBrushFromCache

  • resolveBrushFromCache(cache: BrushCache | undefined, opacity: number, canDraw?: boolean): IBrush2D | undefined
  • Resolves a brush from cache and reapplies opacity.

    Parameters

    • cache: BrushCache | undefined
    • opacity: number
    • Default value canDraw: boolean = true

    Returns IBrush2D | undefined

Protected resolveEffectiveSnapMode

Protected resolveGeometry

  • Parameters

    • pixelPoints: Point[]

    Returns TChannelGeometry

resolveInteractionCursor

  • resolveInteractionCursor(mousePoint?: Point): string | undefined
  • Returns the cursor resolved for current interaction state.

    Parameters

    • Optional mousePoint: Point

    Returns string | undefined

resolveLabelLayouts

Protected resolvePenFromCache

  • resolvePenFromCache(cache: Pen2DCache | undefined, thickness: number, opacity: number, canDraw?: boolean): IPen2D | undefined
  • Resolves a pen from cache and reapplies opacity.

    Parameters

    • cache: Pen2DCache | undefined
    • thickness: number
    • opacity: number
    • Default value canDraw: boolean = true

    Returns IPen2D | undefined

resolveSnap

Protected resolveSnapByMouse

  • resolveSnapByMouse(mousePoint: Point, fallbackValue: Point): TSnapResult
  • Resolves snap from a mouse point in canvas coordinates.

    Parameters

    • mousePoint: Point
    • fallbackValue: Point

    Returns TSnapResult

Protected resolveSnapFromDataPoint

Protected resolveSnapFromMousePoint

  • resolveSnapFromMousePoint(defaultValue: Point): TSnapResult

resumeInvalidate

  • resumeInvalidate(): void
  • Internal use. If isHidden,x1,y1 have change since suspendInvalidate was called, call invalidateParent

    Returns void

Protected setAnnotationBorders

  • setAnnotationBorders(x1: number, x2: number, y1: number, y2: number): void
  • Sets annotationBorders For renderContext annotations it is scaled and for SVG annotations it is not For example if we have a macbook with retina display and canvas.width = 1600px, canvas.height = 1200px, canvas.style.width = 800px, canvas.style.height = 600px If we have {@link BoxAnnotation} (renderContext) which takes 50% width and height, located in the left-top corner it should have annotationBorders as follows x1 = 0, x2 = 800, y1 = 0, y2 = 600 But if we have {@link CustomAnnotation} (SVG) which takes 50% width and height, located in the left-top corner it should have annotationBorders as follows x1 = 0, x2 = 400, y1 = 0, y2 = 300

    Parameters

    • x1: number
    • x2: number
    • y1: number
    • y2: number

    Returns void

setPlacementPoints

  • setPlacementPoints(points: Point[]): void

setPointValue

  • setPointValue(index: number, point: Point): void

Protected setPointsInternal

  • setPointsInternal(points: Point[] | undefined, notify?: boolean): void
  • inheritdoc

    Parameters

    • points: Point[] | undefined
    • Default value notify: boolean = true

    Returns void

setRenderLayer

  • setRenderLayer(value: number | EDefaultRenderLayer): void
  • The render layer grouping within which the series will be draw. Defaults to EDefaultRenderLayer.AnnotationsAboveSeriesLayer

    Parameters

    • value: number | EDefaultRenderLayer

    Returns void

setRenderNextTo

  • setRenderNextTo(renderable: IOrderedRenderable | string, offset?: number): void
  • Parameters

    • renderable: IOrderedRenderable | string
    • Default value offset: number = 0

    Returns void

setRenderOrder

  • setRenderOrder(value: number): void

setSurfaceRenderOrder

  • setSurfaceRenderOrder(value: number): void
  • Allows an annotation to be treated as if it was drawn on a surface with a different draw order than its actual parent surface

    Parameters

    • value: number

    Returns void

Protected shouldRenderFill

  • shouldRenderFill(fill: string | null | undefined): boolean
  • Shared helper to test whether a fill brush should be rendered.

    Parameters

    • fill: string | null | undefined

    Returns boolean

Protected shouldRenderStroke

  • shouldRenderStroke(stroke: string | null | undefined): boolean
  • Shared helper to test whether a stroke should be rendered.

    Parameters

    • stroke: string | null | undefined

    Returns boolean

Protected shouldShowGrips

  • shouldShowGrips(): boolean

Protected shouldShowSelectionAdorner

  • shouldShowSelectionAdorner(): boolean

snapPlacementPoint

  • snapPlacementPoint(value: Point, mousePoint?: Point): Point

suspendInvalidate

  • suspendInvalidate(): void
  • Internal use. Captures the state of isHidden,x1,y1 and prevents invalidateParent being called on change to these properties

    Returns void

svgStringAdornerTemplate

  • svgStringAdornerTemplate(_x1: number, _y1: number, _x2: number, _y2: number): string

toJSON

  • toJSON(): { options: {}; type: EAnnotationType }
  • inheritdoc

    Returns { options: {}; type: EAnnotationType }

    • options: {}
    • type: EAnnotationType

translateAllPoints

  • translateAllPoints(deltaX: number, deltaY: number): void

Protected trySnapPointsOnInit

  • trySnapPointsOnInit(): void
  • Snaps initial points once after attach when enabled.

    Returns void

Protected updateAdornerInner

  • updateAdornerInner(): void
  • Updates adorner SVG for selected/hovered states.

    Returns void

Protected updateAnnotationBordersFromPixels

  • updateAnnotationBordersFromPixels(pixelPoints: Point[]): void

Protected updateBrushCache

  • updateBrushCache(cache: BrushCache | undefined, fill: string | null | undefined, opacity: number): BrushCache | undefined
  • Ensures and refreshes a brush cache.

    Parameters

    • cache: BrushCache | undefined
    • fill: string | null | undefined
    • opacity: number

    Returns BrushCache | undefined

Protected updateDragPointDefinitions

  • updateDragPointDefinitions(): void

Protected updatePenCache

  • updatePenCache(cache: Pen2DCache | undefined, stroke: string | undefined, thickness: number, opacity: number, strokeDashArray?: number[]): Pen2DCache | undefined
  • Ensures and refreshes a pen cache.

    Parameters

    • cache: Pen2DCache | undefined
    • stroke: string | undefined
    • thickness: number
    • opacity: number
    • Optional strokeDashArray: number[]

    Returns Pen2DCache | undefined

Object literals

Protected annotationBorders

annotationBorders: object

the annotation absolute coordinates

x1

x1: number = 0

x2

x2: number = 0

y1

y1: number = 0

y2

y2: number = 0

Generated using TypeDoc