Creates an instance of NumericCoordinateCalculator
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
The size of the associated Axis at the time of drawing
The AxisCore.visibleRange.min at the time of drawing
The AxisCore.visibleRange.max at the time of drawing
A constant pixel offset used in coordinate calculations
When true, calculate using 32-bit floating point values (faster, but less accurate)
When true, this coordinate calculator has flipped coordinates
When true, this coordinate calculator behaves as a Category coordinate calculator, using index not x-value for measuring
Gets the native (WebAssembly) {@link CoordinateCalculator} instance
Gets or sets a constant offset in pixels for all generated coordinates
Gets or sets the ViewportDimension, corresponding to the size of the associated Axis at the time of drawing
Gets or sets the Visible maximum value, corresponding to AxisCore.visibleRange.max at the time of drawing
Gets or sets the Visible minimum value, corresponding to AxisCore.visibleRange.min at the time of drawing
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
Deletes native (WebAssembly) memory used by this type, after which it cannot be used.
Converts the Data-value to a pixel coordinate Performs the inverse operation to getDataValue
The data-value
the pixel coordinate
Converts the pixel coordinate to a Data-value. Performs the inverse operation to getCoordinate
The pixel coordiante
the data value
Translates a NumberRange in Data-coordinates by a specified number of pixels, performing intermediate calculations from data-value to pixel and back to perform the translation
The pixels to translate
The NumberRange to translate. For example this could be an Axis.visibleRange
The translated range
Zooms a NumberRange by a specified fractional amount
The fraction to zoom the NumberRange.min by. A fraction of 0.1 zooms the minimum by 10%
The fraction to zoom the NumberRange.max by. A fraction of 0.1 zooms the maximum by 10%
The NumberRange to zoom
The zoomed range
Generated using TypeDoc
Provides an implementation of Numeric Coordinate Calculator which transforms numeric data-values to pixel coordinates and vice versa.
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.