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

annotationLayer

annotationLayer: EAnnotationLayer
description

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

remarks

applicable only to WebGL annotations

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

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

isSelected

isSelected: boolean
description

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

Readonly isSvgAnnotation

isSvgAnnotation: boolean
description

defines if the annotations is SVG annotation or RenderContext annotation

isVerticalChart

isVerticalChart: boolean
description

if true, the chart is vertical

opacity

opacity: number

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

parentSurface

parentSurface: SciChartSurface
description

the parent SciChartSurface for this annotation

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

xAxisId

xAxisId: string
summary

The current XAxis Id that this IAnnotation is bound to

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); // Has Id = AxisCore.DEFAULT_AXIS_ID
const primaryYAxis = new NumericAxis(wasmContext); // Has Id = AxisCore.DEFAULT_AXIS_ID

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); // xAxisId, yAxisId Defaults to AxisCore.DEFAULT_AXIS_ID
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);
remarks

The default value is set to AxisCore.DEFAULT_AXIS_ID.

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

yAxisId

yAxisId: string
summary

The current YAxis Id that this IAnnotation is bound to

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); // Has Id = AxisCore.DEFAULT_AXIS_ID
const primaryYAxis = new NumericAxis(wasmContext); // Has Id = AxisCore.DEFAULT_AXIS_ID

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); // xAxisId, yAxisId Defaults to AxisCore.DEFAULT_AXIS_ID
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);
remarks

The default value is set to AxisCore.DEFAULT_AXIS_ID.

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

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