UNPKG

scichart

Version:

Fast WebGL JavaScript Charting Library and Framework

79 lines (78 loc) 4.35 kB
import { TDataSeriesDefinition } from "../../../Builder/buildDataSeries"; import { EAxisType } from "../../../types/AxisType"; import { NumberArray } from "../../../types/NumberArray"; import { IndexCalculator, SCRTDoubleVector, TSciChart } from "../../../types/TSciChart"; import { IDataSeries } from "../../Model/IDataSeries"; import { CoordinateCalculatorBase } from "../../Numerics/CoordinateCalculators/CoordinateCalculatorBase"; import { AxisBase2D } from "./AxisBase2D"; import { INumericAxisOptions } from "./NumericAxis"; /** * Optional parameters used to configure a {@link BaseValueAxis} at construct time */ export interface IBaseValueAxisOptions extends INumericAxisOptions { /** Optional base x values to use. If not supplied, the x values from the first renderableSeries will be used. * BaseValueAxis spaces these values evenly along the axis (ie by index), and also uses them to convert from data x values to indexes. * If passing a dataSeries, the x values will be used, even if the axis is a Y axis. */ baseValues?: IDataSeries | NumberArray | TDataSeriesDefinition; /** The normal gap between base x values. If this is set to 0, the axis will be in continuous mode where gaps are compressed, not removed. */ dataGap?: number; } /** * @summary A 2D Chart Index Axis type * @description This uses explicit base values which are plotted by index (ie evenly spaced) and also used to convert from data x values to indexes. * This allows for a non-linear axis with data values interpolated between the base values, meaning that it can support series with different number of points, and series with multiple points on the same x value. * BaseValueAxis is continuous, ie gaps are compressed, not removed. It uses Numeric delta calculation and label formatting. * For Date/Time based data with gaps removed, use {@link DiscontinuousDateAxis} instead. * @remarks * Set a {@link BaseValueAxis} on the {@link SciChartSurface.xAxes} property. * * --- * 📚 Docs: TODO */ export declare class BaseValueAxis extends AxisBase2D { readonly type: EAxisType; protected indexCalculator: IndexCalculator; protected baseValuesDataSeries: IDataSeries | undefined; protected lastBaseValuesDataSeries: IDataSeries | undefined; private lastBaseValuesDataSeriesChangeCount; private baseValuesDataSeriesFromArray; private emptyVector; /** * Creates an instance of a {@link BaseValueAxis} * @param webAssemblyContext The {@link TSciChart | SciChart 2D WebAssembly Context} containing native methods and * access to our WebGL2 Engine and WebAssembly numerical methods * @param options Optional parameters of type {@link IBaseValueAxisOptions} used to configure the axis at instantiation time * * --- * 📚 Docs: TODO */ constructor(webAssemblyContext: TSciChart, options?: IBaseValueAxisOptions); /** * @inheritDoc */ get isLinearAxis(): boolean; /** Gets the normal gap between base values. If this is set to 0, the axis will be in continuous mode where gaps are compressed, not removed. */ get dataGap(): number; /** Sets the normal gap between base values. If this is set to 0, the axis will be in continuous mode where gaps are compressed, not removed. */ set dataGap(value: number); protected getMajorTickIndex(tick: number): number; /** @inheritDoc */ prepareRenderData(): void; /** @inheritDoc */ protected getCurrentCoordinateCalculatorInternal(): CoordinateCalculatorBase; /** @inheritDoc */ delete(): void; /** Gets the dataSeries used for the base values. If this was not set explicitly it will be a reference to the dataSeries of the first renderableSeries */ getBaseValues(): IDataSeries; /** * Set a data series to use as the base values for the axis. The x values will be used, even if the axis is a Y axis * @param dataSeries */ setBaseValues(dataSeries: IDataSeries): void; setBaseValuesFromArray(values: NumberArray): void; protected updateIndexCalculatorBaseValues(): void; protected updateIndexCalculatorBaseValuesInternal(vector: SCRTDoubleVector): void; /** @inheritDoc */ toJSON(): import("../../..").TAxisDefinition; }