Options
All
  • Public
  • Public/Protected
  • All
Menu

Defines the interface to an Annotation - a type of marker, text label, line or custom UI overlay on a 2D Cartesian SciChartSurface

Hierarchy

Implemented by

Index

Properties

adornerClipping

adornerClipping: string | EAnnotationClippingMode

The clipping mode of the annotation adorners

annotationLayer

annotationLayer: EAnnotationLayer
description

The layer to place the annotation on. See EAnnotationLayer for a list of values

remarks

applicable only to WebGL annotations

checkIsWithinBounds

checkIsWithinBounds: (args: ModifierMouseArgs) => boolean

Calculates if pointer is within entity bounds

Type declaration

clipping

clipping: string | EAnnotationClippingMode

The clipping mode of the annotation

getRenderLayer

getRenderLayer: () => number

Type declaration

    • (): number
    • Returns number

getRenderNextTo

getRenderNextTo: () => { offset: number; renderable: IOrderedRenderable | string } | undefined

Type declaration

getRenderOrder

getRenderOrder: () => number

An explicit position for this item to render within the layer. By default, items will render in the order they were added to the collection. Items with a renderOrder set will be inserted at the desired position.

Type declaration

    • (): number
    • Returns number

getSurfaceRenderOrder

getSurfaceRenderOrder: () => number

Allows a series to be treated as if it was drawn on a surface with a different draw order than its actual parent surface Until the chart is rendered, the get method will only return a value if one has been explicitly set.

Type declaration

    • (): number
    • Returns number

hover

hover: (options: IHoverOptions) => void

Executes a hover action on the annotation if it is hit

Type declaration

hovered

hovered: EventHandler<any>

Fires based on hover rules passed into hover

Readonly id

id: string

A unique Id for the IAnnotation

invalidateParentCallback

invalidateParentCallback: () => void
description

callback which notifies the parent SciChartSurface it's time to draw

Type declaration

    • (): void
    • Returns void

Readonly isDomAnnotation

isDomAnnotation: boolean
description

defines if the annotation is rendered as HTMLElement or on WebGL Canvas via RenderContext

readonly

Check for other versions that are drawn with alternative approaches if needed

isEditable

isEditable: boolean
description

if true, the annotation is editable (can be dragged and manipulated by the user)

isHidden

isHidden: boolean
description

if true, the annotation is hidden

isHovered

isHovered: boolean

Defines if the entity is hovered

isSelected

isSelected: boolean
description

When true, the annotation is selected and resize adorners will be displayed

Readonly isSvgAnnotation

isSvgAnnotation: boolean
description

defines if the annotation is SVG annotation

isVerticalChart

isVerticalChart: boolean
description

if true, the chart is vertical

isVisible

isVisible: boolean

opacity

opacity: number

Sets an opacity override for the entire annotation, from 0..1

parentSurface

parentSurface: SciChartSurfaceBase
description

the parent SciChartSurfaceBase for this annotation

setRenderNextTo

setRenderNextTo: (renderable: IOrderedRenderable | string, offset: number) => void

Type declaration

setRenderOrder

setRenderOrder: (order: number) => void

Type declaration

    • (order: number): void
    • Parameters

      • order: number

      Returns void

Readonly surfaceTypes

surfaceTypes: ESurfaceType[]
description

compatible surface types. See EAnnotationType for a list of values

Readonly type

description

annotation type. See EAnnotationType for a list of values

x1

x1: number
description

the X1 coordinate of the annotation

remarks

The X1 coordinate obeys xCoordinateMode which defines whether the X1 coordinate is a pixel, data-value or relative coordinate

x2

x2: number
description

the X2 coordinate of the annotation

remarks

The X1 coordinate obeys xCoordinateMode which defines whether the X2 coordinate is a pixel, data-value or relative coordinate

Readonly xAxis

xAxis: AxisBase2D | undefined

Gets the bound XAxis for this IAnnotation.

xAxisId

xAxisId: string | undefined
summary

The current XAxis Id that this IAnnotation is bound to. If undefined it will use the first X axis attached to SciChartSurface

description

By default all Annotations will draw on the first X,Y axis pair in SciChart. If you want this to change, you must add a second axis to your SciChartSurface and link the IAnnotation by Axis Id.

For example:

const sciChartSurface: SciChartSurface;
const primaryXAxis = new NumericAxis(wasmContext);
const primaryYAxis = new NumericAxis(wasmContext);

const secondaryXAxis = new NumericAxis(wasmContext); // For subsequent X,Y axis set an Id
secondaryXAxis.id = "SecondaryXAxis";
const secondaryYAxis = new NumericAxis(wasmContext);
secondaryYAxis.id = "SecondaryYAxis";

// Add all Axis to the chart
sciChartSurface.xAxes.add(primaryXAxis);
sciChartSurface.yAxes.add(primaryYAxis);
sciChartSurface.xAxes.add(secondaryXAxis);
sciChartSurface.yAxes.add(secondaryYAxis);

// Add an Annotation on the default axis
const annotation = new LineAnnotation(wasmContext);
sciChartSurface.renderableSeries.add(annotation);

// Add an Annotation on the specific axis
const annotation2 = new LineAnnotation(wasmContext);
annotation2.xAxisId = "SecondaryXAxis";
annotation2.yAxisId = "SecondaryYAxis";
sciChartSurface.renderableSeries.add(annotation2);

xCoordinateMode

xCoordinateMode: ECoordinateMode

The X-Coordinate mode. See ECoordinateMode for a list of values

remarks

Want to display an annotation stretching across the entire width (or height) or the SciChartSurface? The ECoordinateMode enum has options which allow for relative, absolute or pixel coordinates which define annotation placement.

y1

y1: number
description

the Y1 coordinate of the annotation

remarks

The Y1 coordinate obeys xCoordinateMode which defines whether the Y1 coordinate is a pixel, data-value or relative coordinate

y2

y2: number
description

the Y2 coordinate of the annotation

remarks

The Y2 coordinate obeys xCoordinateMode which defines whether the Y2 coordinate is a pixel, data-value or relative coordinate

Readonly yAxis

yAxis: AxisBase2D | undefined

Gets the bound YAxis for this IAnnotation.

yAxisId

yAxisId: string | undefined
summary

The current YAxis Id that this IAnnotation is bound to. If undefined it will use the first X axis attached to SciChartSurface

description

By default all Annotations will draw on the first X,Y axis pair in SciChart. If you want this to change, you must add a second axis to your SciChartSurface and link the IAnnotation by Axis Id.

For example:

const sciChartSurface: SciChartSurface;
const primaryXAxis = new NumericAxis(wasmContext);
const primaryYAxis = new NumericAxis(wasmContext);

const secondaryXAxis = new NumericAxis(wasmContext); // For subsequent X,Y axis set an Id
secondaryXAxis.id = "SecondaryXAxis";
const secondaryYAxis = new NumericAxis(wasmContext);
secondaryYAxis.id = "SecondaryYAxis";

// Add all Axis to the chart
sciChartSurface.xAxes.add(primaryXAxis);
sciChartSurface.yAxes.add(primaryYAxis);
sciChartSurface.xAxes.add(secondaryXAxis);
sciChartSurface.yAxes.add(secondaryYAxis);

// Add an Annotation on the default axis
const annotation = new LineAnnotation(wasmContext);
sciChartSurface.renderableSeries.add(annotation);

// Add an Annotation on the specific axis
const annotation2 = new LineAnnotation(wasmContext);
annotation2.xAxisId = "SecondaryXAxis";
annotation2.yAxisId = "SecondaryYAxis";
sciChartSurface.renderableSeries.add(annotation2);

yCoordinateMode

yCoordinateMode: ECoordinateMode

The Y-Coordinate mode. See ECoordinateMode for a list of values

remarks

Want to display an annotation stretching across the entire width (or height) or the SciChartSurface? The ECoordinateMode enum has options which allow for relative, absolute or pixel coordinates which define annotation placement.

Methods

checkIsClickedOnAnnotation

  • checkIsClickedOnAnnotation(x: number, y: number): boolean
  • Checks if passed point on the canvas is inside annotation borders

    Parameters

    • x: number

      the X screen coordinate relative to canvas

    • y: number

      the Y screen coordinate relative to canvas

    Returns boolean

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

linkAxes

  • linkAxes(): void
  • Used internally - Sets references to X and Y axes

    Returns void

onAttach

  • description

    Called when the annotation is attached to a parent SciChartSurface.

    Parameters

    Returns void

onDetach

  • onDetach(): void
  • description

    Called when the annotation is detached from a parent SciChartSurface.

    Returns void

Protected onDpiChanged

  • Called when the Dpi changes in the browser. This could be due to user zooming the browser, or changing DPI settings in Windows, or moving the browser containing SciChart to another monitor

    Parameters

    Returns void

toJSON

  • toJSON(): any
  • Convert the object to a definition that can be serialized to JSON, or used directly with the builder api

    Returns any

Generated using TypeDoc