Options
All
  • Public
  • Public/Protected
  • All
Menu

Draws an axis using our WebGL Rendering engine

Hierarchy

  • AxisRenderer

Implements

Index

Constructors

constructor

  • new AxisRenderer(webAssemblyContext: TSciChart): AxisRenderer
  • Creates an instance of a AxisRenderer

    Parameters

    • webAssemblyContext: TSciChart

      The {@link TSciChart | SciChart 2D WebAssembly Context} containing native methods and access to our WebGL2 Engine and WebAssembly numerical methods

    Returns AxisRenderer

Properties

drawDebug

drawDebug: boolean = false

Protected parentAxis

parentAxis: AxisBase2D

textureManager

textureManager: TextureManager

viewRect

viewRect: Rect = Rect.createZero()

Accessors

axisThickness

  • get axisThickness(): number
  • set axisThickness(value: number): void
  • Gets or sets axis label area thickness, by default the size is calculated to have enough space for labels. However, this property allows to set minimal width/height for vertical/horizontal axes. Useful to align seriesViewRects for different charts

    Returns number

  • Gets or sets axis label area thickness, by default the size is calculated to have enough space for labels. However, this property allows to set minimal width/height for vertical/horizontal axes. Useful to align seriesViewRects for different charts

    Parameters

    • value: number

    Returns void

desiredHeight

  • get desiredHeight(): number
  • set desiredHeight(height: number): void
  • Called internally - Gets or sets desired height during the layout process

    Returns number

  • Called internally - Gets or sets desired height during the layout process

    Parameters

    • height: number

    Returns void

desiredWidth

  • get desiredWidth(): number
  • set desiredWidth(width: number): void
  • Called internally - Gets or sets desired width during the layout process

    Returns number

  • Called internally - Gets or sets desired width during the layout process

    Parameters

    • width: number

    Returns void

hideOverlappingLabels

  • get hideOverlappingLabels(): boolean
  • set hideOverlappingLabels(value: boolean): void
  • Gets or sets hideOverlappingLabels property. Default (true) is to not show labels that would overlap. When using rotation you may want to set this false, as the bounding box of rotated text may overlap even if the text itself does not.

    Returns boolean

  • Gets or sets hideOverlappingLabels property. Default (true) is to not show labels that would overlap. When using rotation you may want to set this false, as the bounding box of rotated text may overlap even if the text itself does not.

    Parameters

    • value: boolean

    Returns void

keepLabelsWithinAxis

  • get keepLabelsWithinAxis(): boolean
  • set keepLabelsWithinAxis(value: boolean): void
  • Gets or sets keepLabelsWithinAxis property. When true (default), first and last labels will be shifted to stay within axis bounds. If set to false, these labels will stay aligned to their ticks

    Returns boolean

  • Gets or sets keepLabelsWithinAxis property. When true (default), first and last labels will be shifted to stay within axis bounds. If set to false, these labels will stay aligned to their ticks

    Parameters

    • value: boolean

    Returns void

Methods

adjustForLabelAlignment

  • adjustForLabelAlignment(xCoord: number, labelWidth: number, labelAlignment: ELabelAlignment, axisAlignment: EAxisAlignment, isInnerAxis: boolean, axisWidth: number, tickSize: number): number
  • Called internally - adjusts labels for label alignment

    Parameters

    • xCoord: number
    • labelWidth: number
    • labelAlignment: ELabelAlignment
    • axisAlignment: EAxisAlignment
    • isInnerAxis: boolean
    • axisWidth: number
    • tickSize: number

    Returns number

attachedToAxis

  • Called when the AxisRenderer is attached to an Axis

    Parameters

    Returns void

calcDesiredLabelsSize

  • calcDesiredLabelsSize(isHorizontalAxis: boolean, labelProvider: LabelProviderBase2D, labelStyle: TTextStyle, majorTickLabels: string[]): number
  • Called internally - calculates desired labels size

    Parameters

    Returns number

createAnnotationLabelTexture

  • createAnnotationLabelTexture(text: string, textStyle: TTextStyle, backgroundColor?: string, displayVertically?: boolean, displayMirrored?: boolean, opacity?: number): { bitmapTexture: TSRTexture; textureHeight: number; textureWidth: number }
  • Called internally

    Parameters

    • text: string
    • textStyle: TTextStyle
    • Optional backgroundColor: string
    • Optional displayVertically: boolean
    • Optional displayMirrored: boolean
    • Optional opacity: number

    Returns { bitmapTexture: TSRTexture; textureHeight: number; textureWidth: number }

    • bitmapTexture: TSRTexture
    • textureHeight: number
    • textureWidth: number

createAxisMarker

  • createAxisMarker(axisAlignment: EAxisAlignment, text: string, textStyle: TTextStyle, backgroundColor?: string, opacity?: number): { bitmapTexture: TSRTexture; textureHeight: number; textureWidth: number }
  • Called internally - used for AxisMarkerAnnotation

    Parameters

    • axisAlignment: EAxisAlignment
    • text: string
    • textStyle: TTextStyle
    • Optional backgroundColor: string
    • Optional opacity: number

    Returns { bitmapTexture: TSRTexture; textureHeight: number; textureWidth: number }

    • bitmapTexture: TSRTexture
    • textureHeight: number
    • textureWidth: number

createAxisMarkerFromImage

  • createAxisMarkerFromImage(image: HTMLImageElement, imageWidth: number, imageHeight: number): { bitmapTexture: TSRTexture; textureHeight: number; textureWidth: number }
  • Called internally - used for custom AxisMarkerAnnotation

    Parameters

    • image: HTMLImageElement
    • imageWidth: number
    • imageHeight: number

    Returns { bitmapTexture: TSRTexture; textureHeight: number; textureWidth: number }

    • bitmapTexture: TSRTexture
    • textureHeight: number
    • textureWidth: 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

drawLabels

  • Called internally - draws labels

    Parameters

    Returns void

drawModifiersAxisLabel

  • Called internally - draws axis labels when needed, for example for line annotations

    Parameters

    Returns Rect

drawTicks

  • Called internally

    Parameters

    Returns void

Protected invalidateParent

  • invalidateParent(): void
  • Returns void

layout

  • layout(rect: Rect): void
  • Called internally as a part of the layout process

    Parameters

    Returns void

layoutLabels

  • layoutLabels(size: number, tickCoords: number[], labelSizes: number[], isFlippedCoordinates: boolean, padBefore?: number, padAfter?: number): { labelCoords: number[]; labelIndexes: number[] }
  • Called internally

    Parameters

    • size: number
    • tickCoords: number[]
    • labelSizes: number[]
    • isFlippedCoordinates: boolean
    • Optional padBefore: number
    • Optional padAfter: number

    Returns { labelCoords: number[]; labelIndexes: number[] }

    • labelCoords: number[]
    • labelIndexes: number[]

measure

  • measure(isHorizontalAxis: boolean, labelStyle: TTextStyle, majorTickLabels: string[], ticksSize: number, labelProvider: LabelProviderBase2D, drawLabels: boolean, drawTicks: boolean): void
  • Called internally - measures the axis label area as part of the layout phase

    Parameters

    • isHorizontalAxis: boolean
    • labelStyle: TTextStyle
    • majorTickLabels: string[]
    • ticksSize: number
    • labelProvider: LabelProviderBase2D
    • drawLabels: boolean
    • drawTicks: boolean

    Returns void

Generated using TypeDoc