Options
All
  • Public
  • Public/Protected
  • All
Menu

A OverviewCustomResizableAnnotation presents SVG information over the chart at specific {@link X1}, Y1, {@link X2}, {@link Y2} coordinates.

remarks

The annotation can be moved or resized up to the limits set by minWidth/minHeight properties and axis visible range

Hierarchy

Implements

Index

Constructors

Properties

Accessors

Methods

Object literals

Constructors

constructor

Properties

Protected adornerDraggingPointProperty

adornerDraggingPointProperty: EDraggingGripPoint

Protected annotationsGripsFillProperty

annotationsGripsFillProperty: string = SciChartSurfaceBase.DEFAULT_THEME.annotationsGripsBackroundBrush

Protected annotationsGripsRadiusProperty

annotationsGripsRadiusProperty: number = ADORNER_GRIP_RADIUS

Protected annotationsGripsStrokeProperty

annotationsGripsStrokeProperty: string = SciChartSurfaceBase.DEFAULT_THEME.annotationsGripsBorderBrush

clicked

dragDelta

dragEnded

dragEnded: EventHandler<void>

Protected dragPointsProperty

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

dragStarted

dragStarted: EventHandler<void>

Protected horizontalAnchorPointProperty

horizontalAnchorPointProperty: EHorizontalAnchorPoint = EHorizontalAnchorPoint.Left

hovered

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

Protected invalidateState

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

Type declaration

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

isDeleted

isDeleted: boolean = false

Protected isDirty

isDirty: boolean = true

Protected isHiddenProperty

isHiddenProperty: boolean = false

Readonly isSvgAnnotation

isSvgAnnotation: boolean = true
description

defines if the annotations is SVG annotation or RenderContext annotation

Protected nextSibling

nextSibling: Element

Protected parentSurfaceProperty

parentSurfaceProperty: SciChartSurfaceBase

Protected prevIsSelected

prevIsSelected: boolean = true

Protected prevValue

prevValue: { x: number; y: number }

Type declaration

  • x: number
  • y: number

Protected prevX1Coordinate

prevX1Coordinate: number = 0

Protected prevY1Coordinate

prevY1Coordinate: number = 0

selectedChanged

selectedChanged: EventHandler<boolean>

Protected selectionBoxDeltaProperty

selectionBoxDeltaProperty: number = 1.5

Protected selectionBoxStrokeProperty

selectionBoxStrokeProperty: string = SciChartSurfaceBase.DEFAULT_THEME.annotationSelectionStroke

Protected selectionBoxThicknessProperty

selectionBoxThicknessProperty: number = 6

showWarning

showWarning: boolean = true

Protected svgAdorner

svgAdorner: SVGElement

Protected svgDOMRect

svgDOMRect: DOMRect

Readonly type

type: SVGCustomAnnotation = EAnnotationType.SVGCustomAnnotation
description

annotation type. See EAnnotationType for a list of values

Protected typeMap

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

Protected verticalAnchorPointProperty

verticalAnchorPointProperty: EVerticalAnchorPoint = EVerticalAnchorPoint.Top

Protected xCoordShiftProperty

xCoordShiftProperty: number = 0

The {@link SVGElement} which will be added to the chart

Protected yCoordShiftProperty

yCoordShiftProperty: number = 0

Accessors

adornerDraggingPoint

adornerSvgStringTemplate

  • get adornerSvgStringTemplate(): (x1: number, y1: number, x2: number, y2: number) => string
  • set adornerSvgStringTemplate(value: (x1: number, y1: number, x2: number, y2: number) => string): void
  • Gets or sets the SVG template of the annotation adorner

    Returns (x1: number, y1: number, x2: number, y2: number) => string

      • (x1: number, y1: number, x2: number, y2: number): string
      • Parameters

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

        Returns string

  • Gets or sets the SVG template of the annotation adorner

    Parameters

    • value: (x1: number, y1: number, x2: number, y2: number) => string
        • (x1: number, y1: number, x2: number, y2: number): string
        • Parameters

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

          Returns string

    Returns void

annotationLayer

annotationsGripsFill

  • get annotationsGripsFill(): string
  • set annotationsGripsFill(color: string): void
  • The fill color for the adorner drag handle

    inheritdoc

    Returns string

  • The fill color for the adorner drag handle

    inheritdoc

    Parameters

    • color: string

    Returns void

annotationsGripsRadius

  • get annotationsGripsRadius(): number
  • set annotationsGripsRadius(radius: number): void
  • The radius of the adorner drag handle

    inheritdoc

    Returns number

  • The radius of the adorner drag handle

    inheritdoc

    Parameters

    • radius: number

    Returns void

annotationsGripsStroke

  • get annotationsGripsStroke(): string
  • set annotationsGripsStroke(color: string): void
  • The stroke color for the adorner drag handle

    inheritdoc

    Returns string

  • The stroke color for the adorner drag handle

    inheritdoc

    Parameters

    • color: string

    Returns void

dragPoints

  • 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

    Returns void

horizontalAnchorPoint

isDraggingStarted

  • get isDraggingStarted(): boolean

isEditable

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

    Returns boolean

  • inheritdoc

    Parameters

    • isEditable: boolean

    Returns void

isHidden

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

    Returns boolean

  • inheritdoc

    Parameters

    • isHidden: boolean

    Returns 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
  • inheritdoc

    Returns boolean

  • inheritdoc

    Parameters

    • value: boolean

    Returns void

isVerticalChart

  • get isVerticalChart(): boolean

minHeight

  • get minHeight(): number
  • set minHeight(value: number): void
  • Gets or sets the minimum width of the annotation

    Returns number

  • Gets or sets the minimum width of the annotation

    Parameters

    • value: number

    Returns void

minWidth

  • get minWidth(): number
  • set minWidth(value: number): void
  • Gets or sets the minimum width of the annotation

    Returns number

  • Gets or sets the minimum width of the annotation

    Parameters

    • value: number

    Returns 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

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
  • The stroke color for the adorner selection box

    inheritdoc

    Returns string

  • The stroke color for the adorner selection box

    inheritdoc

    Parameters

    • color: string

    Returns void

selectionBoxThickness

  • get selectionBoxThickness(): number
  • set selectionBoxThickness(delta: number): void
  • The thickness of the selection box line

    inheritdoc

    Returns number

  • The thickness of the selection box line

    inheritdoc

    Parameters

    • delta: number

    Returns void

svg

  • get svg(): SVGElement
  • Returns SVGElement

Protected svgAdornerRoot

  • get svgAdornerRoot(): SVGSVGElement

Protected svgRoot

  • get svgRoot(): SVGSVGElement
  • Gets the {@link SVGSVGElement | SVG Element} at the root of this annotation

    Returns SVGSVGElement

svgString

  • get svgString(): string
  • set svgString(value: string): void
  • SVG dom element string provided by the user

    Returns string

  • SVG dom element string provided by the user

    Parameters

    • value: string

    Returns void

verticalAnchorPoint

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

xAxisId

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

    Returns string

  • inheritdoc

    Parameters

    • xAxisId: string

    Returns void

xCoordShift

  • get xCoordShift(): number
  • set xCoordShift(value: number): void
  • Gets or sets an offset to shift X-coordinates

    Returns number

  • Gets or sets an offset to shift X-coordinates

    Parameters

    • value: number

    Returns void

xCoordinateMode

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

yAxisId

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

    Returns string

  • inheritdoc

    Parameters

    • yAxisId: string

    Returns void

yCoordShift

  • get yCoordShift(): number
  • set yCoordShift(value: number): void
  • Gets or sets an offset to shift Y-coordinates

    Returns number

  • Gets or sets an offset to shift Y-coordinates

    Parameters

    • value: number

    Returns void

yCoordinateMode

Methods

Protected calcAndSetAnnotationBorders

calcDragDistance

  • calcDragDistance(xyValues: Point): void
  • Handles the dragging event. Updates the coordinates after dragging or resizing

    Parameters

    Returns void

canDragPoint

  • Override this to disable drag behaviour for certain dragging points

    Parameters

    Returns boolean

checkIsClickedOnAnnotation

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

Protected checkIsClickedOnAnnotationInternal

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

checkIsWithinBounds

Protected clear

  • clear(): void
  • Returns void

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 convertFromCoordinate

Protected create

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

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 getCoordinate

getSvgString

  • This is called to get the svg string to use. Override this to customise the svg string for each render

    Parameters

    Returns string

Protected getValue

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 ECoordinateMode

Protected getX1Coordinate

Protected getX2Coordinate

Protected getXYCoordinatesFromValues

  • getXYCoordinatesFromValues(xyDataPoint: Point): Point

Protected getY1Coordinate

Protected getY2Coordinate

hover

  • Sends hover/leave action to the annotation

    Parameters

    Returns void

Protected notifyPropertyChanged

  • notifyPropertyChanged(propertyName: string): void

onAttach

onDetach

  • onDetach(): void

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

onDragAdorner

onDragEnded

  • onDragEnded(): void

onDragStarted

resumeInvalidate

  • resumeInvalidate(): void

Protected selectSvgRoot

  • selectSvgRoot(): 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

setCoordinates

  • setCoordinates(coordinates: { x1?: number; x2?: number; y1?: number; y2?: number }): void
  • Updates the annotation position and size while maintaining limits set by minWidth and minHeight

    Parameters

    • coordinates: { x1?: number; x2?: number; y1?: number; y2?: number }

      an object with the coordinates - {x1, x2, y1, y2}

      • Optional x1?: number
      • Optional x2?: number
      • Optional y1?: number
      • Optional y2?: number

    Returns void

Protected setSvg

  • setSvg(svg: SVGElement): void
  • Parameters

    • svg: SVGElement

    Returns void

Protected setSvgAttribute

  • setSvgAttribute(attributeName: string, value: number): void
  • Parameters

    • attributeName: string
    • value: number

    Returns void

suspendInvalidate

  • suspendInvalidate(): void

svgStringAdornerTemplate

  • svgStringAdornerTemplate(x1: number, y1: number, x2: number, y2: number): string

toJSON

update

Protected updateAdornerInner

  • updateAdornerInner(): void
  • Creates or updates an adorner for the annotation

    Returns void

updateSvg

  • This is called on the svg element immediately after it is created. Use this to do adjustments or additions to it which require knowlege of its size. For instance, this method adds a bounding rectangle to the existing svg

    updateSvg(annotation: CustomAnnotation, svg: SVGSVGElement) {
       const annotationRect = svg.getBoundingClientRect();
       const padding = 5;
       // Offset the existing element by the padding
       (svg.firstChild as SVGElement).setAttribute("x", padding.toString());
       (svg.firstChild as SVGElement).setAttribute("y", padding.toString());
       const rectWidth = annotationRect.width + padding + padding;
       const rectHeight = annotationRect.height + padding + padding;
       const namespace = "http://www.w3.org/2000/svg";
       const newRect = document.createElementNS(namespace, "rect");
       newRect.setAttribute("x", "0");
       newRect.setAttribute("y", "0");
       newRect.setAttribute("width", `${rectWidth}`);
       newRect.setAttribute("height", `${rectHeight}`);
       newRect.setAttribute("fill", `red`);
       return svg;
    }

    Parameters

    Returns SVGSVGElement

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