Options
All
  • Public
  • Public/Protected
  • All
Menu

Provides an implementation of Flipped Index Coordinate Calculator which transforms numeric data-values to pixel coordinates and vice versa using base values.

remarks

SciChart's JavaScript Charts perform conversion operations between data-coordinates for all drawing and axis measurements.

You can fetch a CoordinateCalculator instance by calling AxisCore.getCurrentCoordinateCalculator. This will return a unique calculator for the current draw pass.

You can convert pixel to data-coordinates and back by using the following code:

const axis: AxisCore;
const calc = axis.getCurrentCoordinateCalculator();

const pixel = calc.getCoordinate(1.23); // Gets the pixel coordinate for data-value 1.23
const dataValue = cald.getDataValue(pixel); // Performs the inverse operation to get data-value

Use the Coordinate calculators when drawing, placing markers, annotations or if you want to place a tooltip over the chart.

Hierarchy

Implements

Index

Constructors

constructor

  • new FlippedIndexCoordinateCalculator(webAssemblyContext: TSciChart, indexCalculator: IndexCalculator, viewportDimension: number, visibleMin: number, visibleMax: number, indexMin: number, indexMax: number, offset?: number, viewportOffset?: number): FlippedIndexCoordinateCalculator
  • Creates an instance of IndexCoordinateCalculator

    Parameters

    • webAssemblyContext: TSciChart

      The SciChart 2D WebAssembly Context or {@link TSciChart2D | SciChart 2D WebAssembly Context}

    • indexCalculator: IndexCalculator

      The index calculator, it is used to set base values

    • viewportDimension: number

      The size of the associated Axis at the time of drawing

    • visibleMin: number

      The AxisCore.visibleRange.min at the time of drawing

    • visibleMax: number

      The AxisCore.visibleRange.max at the time of drawing

    • indexMin: number

      The minimal visible index

    • indexMax: number

      The maximum visible index

    • Default value offset: number = 0

      A constant pixel offset used in coordinate calculations

    • Default value viewportOffset: number = -1

    Returns FlippedIndexCoordinateCalculator

Properties

Readonly hasFlippedCoordinates

hasFlippedCoordinates: boolean

When true, this coordinate calculator has flipped coordinates

Readonly isCategoryCoordinateCalculator

isCategoryCoordinateCalculator: boolean

When true, this coordinate calculator behaves as a Category coordinate calculator, using index not x-value for measuring

nativeCalculator

nativeCalculator: CoordinateCalculator

Gets the native (WebAssembly) {@link CoordinateCalculator} instance

offset

offset: number

Gets or sets a constant offset in pixels for all generated coordinates

Readonly viewportDimension

viewportDimension: number

Gets or sets the ViewportDimension, corresponding to the size of the associated Axis at the time of drawing

Readonly visibleMax

visibleMax: number

Gets or sets the Visible maximum value, corresponding to AxisCore.visibleRange.max at the time of drawing

Readonly visibleMin

visibleMin: number

Gets or sets the Visible minimum value, corresponding to AxisCore.visibleRange.min at the time of drawing

Protected webAssemblyContext

webAssemblyContext: TSciChart | TSciChart3D

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

Accessors

isFlipped

  • get isFlipped(): boolean
  • Returns isFlipped flag. By default for cartesian chart X axis is not flipped and Y axis is flipped. By default for polar chart both axes are not flipped

    Returns boolean

Methods

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

getCoordWidth

  • getCoordWidth(dataWidth: number): number
  • Converts data width into coordinate width

    Parameters

    • dataWidth: number

    Returns number

getCoordinate

  • getCoordinate(dataValue: number): number
  • inheritdoc

    Parameters

    • dataValue: number

    Returns number

getDataValue

  • getDataValue(coordinate: number): number
  • inheritdoc

    Parameters

    • coordinate: number

    Returns number

getDataWidth

  • getDataWidth(coordWidth: number): number
  • Converts coordinate width into data width

    Parameters

    • coordWidth: number

    Returns number

transformDataToIndex

  • transformDataToIndex(dataValue: number): number
  • Parameters

    • dataValue: number

    Returns number

transformIndexToData

  • transformIndexToData(index: number): number
  • Parameters

    • index: number

    Returns number

translateBy

zoomTranslateBy

Generated using TypeDoc