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

The AxisMarkerAnnotation provides an Annotation which draws a marker at specified value on the axis over the SciChartSurface

description

To add a AxisMarkerAnnotation to a SciChartSurface, use the following code:

const sciChartSurface: SciChartSurface;
const AxisMarkerAnnotation = new AxisMarkerAnnotation( { y1: 3, backgroundColor: "#FF000077", color: "#FF0000"});
sciChartSurface.annotations.add(AxisMarkerAnnotation);
remarks

Uses the fast WebGL/WebAssembly {@link WebGL2RenderingContext} for rendering

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Object literals

Constructors

constructor

Properties

Protected adornerClippingProperty

adornerClippingProperty: EAnnotationClippingMode | string = EAnnotationClippingMode.Chart

Protected adornerDraggingPointProperty

adornerDraggingPointProperty: EDraggingGripPoint

Protected annotationsGripsFillProperty

annotationsGripsFillProperty: string = SciChartSurfaceBase.DEFAULT_THEME.annotationsGripsBackgroundBrush

Protected annotationsGripsRadiusProperty

annotationsGripsRadiusProperty: number = ADORNER_GRIP_RADIUS

Protected annotationsGripsStrokeProperty

annotationsGripsStrokeProperty: string = SciChartSurfaceBase.DEFAULT_THEME.annotationsGripsBorderBrush

clicked

Protected clippingProperty

clippingProperty: EAnnotationClippingMode = EAnnotationClippingMode.Chart

dragDelta

dragEnded

dragEnded: EventHandler<void>

Protected dragPointsProperty

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

dragStarted

dragStarted: EventHandler<void>

hovered

Readonly id

id: string

A unique Id for the IAnnotation

invalidateParentCallback

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

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

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
description

defines if the annotation is SVG annotation

Protected parentSurfaceProperty

parentSurfaceProperty: SciChartSurfaceBase

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

Protected renderOrderProperty

renderOrderProperty: number = undefined

selectedChanged

selectedChanged: EventHandler<boolean>

Protected selectionBoxDeltaProperty

selectionBoxDeltaProperty: number = 1.5

Protected selectionBoxStrokeProperty

selectionBoxStrokeProperty: string = SciChartSurfaceBase.DEFAULT_THEME.annotationSelectionStroke

Protected selectionBoxThicknessProperty

selectionBoxThicknessProperty: number = 6

Protected surfaceRenderOrderProperty

surfaceRenderOrderProperty: number = undefined

Readonly surfaceTypes

surfaceTypes: ESurfaceType[] = [ESurfaceType.SciChartSurfaceType]
description

compatible surface types. See EAnnotationType for a list of values

Protected svgAdorner

svgAdorner: SVGElement

Readonly type

type: EAnnotationType = EAnnotationType.RenderContextAxisMarkerAnnotation
description

annotation type. See EAnnotationType for a list of values

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

adornerDraggingPoint

annotationLayer

annotationsGripsFill

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

annotationsGripsRadius

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

annotationsGripsStroke

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

backgroundColor

  • get backgroundColor(): string
  • set backgroundColor(value: string): void
  • Gets the color of the background of the AxisMarkerAnnotation as an HTML Color code

    Returns string

  • Sets the color of the background of the AxisMarkerAnnotation as an HTML Color code

    Parameters

    • value: string

    Returns void

clipping

color

  • get color(): string
  • set color(value: string): void
  • Gets the color of the AxisMarkerAnnotation as an HTML Color code

    Returns string

  • Sets the color of the AxisMarkerAnnotation as an HTML Color code

    Parameters

    • value: string

    Returns void

dragPoints

fontFamily

  • get fontFamily(): string
  • set fontFamily(value: string): void
  • Gets the fontFamily of the AxisMarkerAnnotation

    Returns string

  • Sets the fontFamily of the AxisMarkerAnnotation

    Parameters

    • value: string

    Returns void

fontSize

  • get fontSize(): number
  • set fontSize(value: number): void
  • Gets the fontSize of the AxisMarkerAnnotation

    Returns number

  • Sets the fontSize of the AxisMarkerAnnotation

    Parameters

    • value: number

    Returns void

fontStyle

  • get fontStyle(): string
  • set fontStyle(value: string): void
  • Gets the fontStyle of the AxisMarkerAnnotation

    Returns string

  • Sets the fontStyle of the AxisMarkerAnnotation

    Parameters

    • value: string

    Returns void

fontWeight

  • get fontWeight(): string
  • set fontWeight(value: string): void
  • Gets the fontWeight of the AxisMarkerAnnotation

    Returns string

  • Sets the fontWeight of the AxisMarkerAnnotation

    Parameters

    • value: string

    Returns void

formattedValue

  • get formattedValue(): string
  • set formattedValue(value: string): void
  • Gets the formattedValue of the AxisMarkerAnnotation

    Returns string

  • Sets the formattedValue of the AxisMarkerAnnotation

    Parameters

    • value: string

    Returns void

image

  • get image(): HTMLImageElement
  • set image(image: HTMLImageElement): void
  • Gets or sets the image to draw as an annotation {@link HTMLImageElement}

    Returns HTMLImageElement

  • Gets or sets the image to draw as an annotation {@link HTMLImageElement}

    Parameters

    • image: HTMLImageElement

    Returns void

imageHeight

  • get imageHeight(): number
  • set imageHeight(value: number): void
  • Gets or sets the image height

    Returns number

  • Gets or sets the image height

    Parameters

    • value: number

    Returns void

imageWidth

  • get imageWidth(): number
  • set imageWidth(value: number): void
  • Gets or sets the image width

    Returns number

  • Gets or sets the image width

    Parameters

    • value: number

    Returns void

isDraggingStarted

  • get isDraggingStarted(): boolean

isEditable

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

isHidden

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

isHovered

  • get isHovered(): boolean
  • set isHovered(value: boolean): void
  • Defines if the entity is hovered

    inheritdoc

    Returns boolean

  • Defines if the entity is hovered

    inheritdoc

    Parameters

    • value: boolean

    Returns void

isSelected

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

isVerticalChart

  • get isVerticalChart(): boolean

isVisible

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

opacity

  • get opacity(): number
  • set opacity(opacity: number): void
  • Sets an opacity override for the entire annotation, from 0..1

    inheritdoc

    Returns number

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

    inheritdoc

    Parameters

    • opacity: number

    Returns void

padding

parentSurface

resizeDirections

selectionBoxDelta

  • get selectionBoxDelta(): number
  • set selectionBoxDelta(delta: number): void
  • How much bigger the selection box is than the bounding box of the annotation, in pixels

    inheritdoc

    Returns number

  • How much bigger the selection box is than the bounding box of the annotation, in pixels

    inheritdoc

    Parameters

    • delta: number

    Returns void

selectionBoxStroke

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

selectionBoxThickness

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

Protected svgAdornerRoot

  • get svgAdornerRoot(): SVGSVGElement

x1

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

x2

  • get x2(): number
  • set x2(x2: number): void
  • x2 property is not supported for AxisMarkerAnnotation

    Returns number

  • x2 property is not supported for AxisMarkerAnnotation

    Parameters

    • x2: number

    Returns void

xAxis

xAxisId

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

xCoordinateMode

y1

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

y2

  • get y2(): number
  • set y2(y2: number): void
  • y2 property is not supported for AxisMarkerAnnotation

    Returns number

  • y2 property is not supported for AxisMarkerAnnotation

    Parameters

    • y2: number

    Returns void

yAxis

yAxisId

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

yCoordinateMode

Methods

Protected applyPixelRatioToDragDist

  • applyPixelRatioToDragDist(dist: number): number

Protected applySvgClipping

calcDragDistance

  • calcDragDistance(xyValues: Point): void

canDragPoint

checkIsClickedOnAnnotation

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

Protected checkIsClickedOnAnnotationInternal

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

checkIsPointWithinClipArea

  • checkIsPointWithinClipArea(mousePoint: Point): boolean

checkIsWithinBounds

click

  • Called internally. Send a click to the annotation if the point is in bounds, raising the clicked event and optionally selecting the annotation.

    Parameters

    Returns boolean

clickToSelect

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

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

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 deleteAdorner

  • deleteAdorner(): void

drawWithContext

Protected getAbsoluteCoordinates

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 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
  • Get svg for the adorner grip handles for standard annotations

    Parameters

    • x: number
    • y: number

    Returns string

Protected getClipPath

getClippingRect

Protected getCoordinate

getRenderLayer

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

    Returns number

getRenderNextTo

getRenderOrder

  • getRenderOrder(): number

Protected getResolvedCoordinate

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

Protected getValuesFromCoordinates

  • getValuesFromCoordinates(point: Point, translateToSeriesViewRect: boolean): Point

Protected getX1Coordinate

Protected getX2Coordinate

Protected getXYCoordinatesFromValues

  • getXYCoordinatesFromValues(xyDataPoint: Point): Point

Protected getY1Coordinate

Protected getY2Coordinate

hover

linkAxes

  • linkAxes(): void

Protected notifyPropertyChanged

  • notifyPropertyChanged(propertyName: string): void
  • summary

    Notifies subscribers of {@link AnnotationBase.propertyChanged} that a property has changed and the chart requires redrawing

    description

    SciChart provides fully reactive components, changing any property or changing data will cause the AnnotationBase to redraw where necessary. This method notifies subscribers of the {@link AnnotationBase.propertyChanged} EventHandler that a property has changed.

    Parameters

    • propertyName: string

      The name of the property which has changed

    Returns void

onAttach

onDetach

  • onDetach(): void

onDpiChanged

onDragAdorner

onDragEnded

  • onDragEnded(): void

onDragStarted

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

setRenderLayer

  • The render layer grouping within which the series will be draw. Defaults to EDefaultRenderLayer.AnnotationsAboveSeriesLayer

    Parameters

    Returns void

setRenderNextTo

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

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

Protected updateAdornerInner

  • updateAdornerInner(): void

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