scichart
Version:
Fast WebGL JavaScript Charting Library and Framework
176 lines (175 loc) • 9.36 kB
TypeScript
import { NumberRange } from "../../Core/NumberRange";
import { NumberArray } from "../../types/NumberArray";
import { SCRTDoubleVector, TSciChart } from "../../types/TSciChart";
import { EYRangeMode } from "../../types/YRangeMode";
import { BaseDataSeries, IBaseDataSeriesOptions } from "./BaseDataSeries";
import { EDataSeriesType, EDataSeriesValueType } from "./IDataSeries";
import { IPointMetadata } from "./IPointMetadata";
/**
* Options to pass to the {@link BoxPlotDataSeries} constructor
*/
export interface IBoxPlotDataSeriesOptions extends IBaseDataSeriesOptions {
/**
* The X-values array to pre-populate the {@link BoxPlotDataSeries}
*/
xValues?: NumberArray;
/**
* The Max-values array to pre-populate the {@link BoxPlotDataSeries}
*/
maximumValues?: NumberArray;
/**
* The Upper Quartile-values array to pre-populate the {@link BoxPlotDataSeries}
*/
upperQuartileValues?: NumberArray;
/**
* The Median-values array to pre-populate the {@link BoxPlotDataSeries}
*/
medianValues?: NumberArray;
/**
* The lower Quartile-values array to pre-populate the {@link BoxPlotDataSeries}
*/
lowerQuartileValues?: NumberArray;
/**
* The Minimum-values array to pre-populate the {@link BoxPlotDataSeries}
*/
minimumValues?: NumberArray;
}
/**
* BoxPlotDataSeries is a DataSeries for holding maximum, upperQuartile, median, lowerQuartile data in SciChart's
* {@link https://www.scichart.com/javascript-chart-features | JavaScript Stock Charts}
* @remarks
* The BoxPlotDataSeries is primarily used with the {@link FastBoxPlotRenderableSeries | JavaScript Candlestick Chart}
*
* A DataSeries stores the data to render. This is independent from the {@link IRenderableSeries | RenderableSeries}
* which defines how that data should be rendered.
*
* See derived types of {@link BaseDataSeries} to find out what data-series are available.
* See derived types of {@link IRenderableSeries} to find out what 2D JavaScript Chart types are available.
*
* ---
* 📚 Docs: {@link
*/
export declare class BoxPlotDataSeries extends BaseDataSeries {
/** @inheritDoc */
readonly type = EDataSeriesType.BoxPlot;
/**
* Creates an instance of {@link BoxPlotDataSeries}
* @param webAssemblyContext the {@link TSciChart | SciChart WebAssembly Context} containing native methods
* and access to our underlying WebGL2 rendering engine
* @param options the {@link IBoxPlotDataSeriesOptions} which can be passed to configure the DataSeries at construct time
*/
constructor(webAssemblyContext: TSciChart, options?: IBoxPlotDataSeriesOptions);
get yValues(): SCRTDoubleVector;
get medianValues(): SCRTDoubleVector;
get maximumValues(): SCRTDoubleVector;
get upperQuartileValues(): SCRTDoubleVector;
get lowerQuartileValues(): SCRTDoubleVector;
get minimumValues(): SCRTDoubleVector;
/**
* Gets a native / WebAssembly vector of Maximum-values in the DataSeries
*/
getNativeMaximumValues(): SCRTDoubleVector;
/**
* Gets a native / WebAssembly vector of Upper Quartile-values in the DataSeries
*/
getNativeUpperQuartileValues(): SCRTDoubleVector;
/**
* Gets a native / WebAssembly vector of Median-values in the DataSeries
*/
getNativeMedianValues(): SCRTDoubleVector;
/**
* Gets a native / WebAssembly vector of lower Quartile-values in the DataSeries
*/
getNativeLowerQuartileValues(): SCRTDoubleVector;
/**
* Gets a native / WebAssembly vector of Minimum-values in the DataSeries
*/
getNativeMinimumValues(): SCRTDoubleVector;
/**
* Appends a single X, Maximum, UpperQuartile, Median, lowerQuartile, Minimum point to the DataSeries
* @remarks
* For best performance on drawing large datasets, use the {@link appendRange} method
*
* Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
* @param x X-value.
* @param maximum The Maximum value for this BoxPlot bar
* @param upperQuartile The UpperQuartile value for this BoxPlot bar
* @param median The Median value for this BoxPlot bar
* @param lowerQuartile The lowerQuartile value for this BoxPlot bar
* @param minimum The Minimum value for this BoxPlot bar
* @param metadata The point metadata
*/
append(x: number, maximum: number, upperQuartile: number, median: number, lowerQuartile: number, minimum: number, metadata?: IPointMetadata): void;
/**
* Appends arrays of X (Date), maximum, upperQuartile, median, lowerQuartile, minimum point to the DataSeries
* @remarks
* This method is considerably upperQuartileer performance than {@link append} which appends a single point
* X-value is a Date, encoded as a Unix Timestamp.
*
* Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
* @param xValues X-values are Dates, encoded as a Unix Timestamp.
* @param maximumValues The maximum values for this BoxPlot bar
* @param upperQuartileValues The upperQuartile values for this BoxPlot bar
* @param medianValues The median values for this BoxPlot bar
* @param lowerQuartileValues The lowerQuartile values for this BoxPlot bar
* @param minimumValues The Minimum values for this BoxPlot bar
* @param metadata The array of point metadata
*/
appendRange(xValues: NumberArray, maximumValues: NumberArray, upperQuartileValues: NumberArray, medianValues: NumberArray, lowerQuartileValues: NumberArray, minimumValues: NumberArray, metadata?: IPointMetadata[]): void;
/**
* Updates a single maximum, upperQuartile, median, lowerQuartile, minimum value by X-index
* @remarks Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
* @param index the index to update
* @param maximum The new maximum value
* @param upperQuartile The new upperQuartile value
* @param median The new median value
* @param lowerQuartile The new lowerQuartile value
* @param minimum The new minimum value
* @param metadata The point metadata
*/
update(index: number, median: number, maximum: number, upperQuartile: number, lowerQuartile: number, minimum: number, metadata?: IPointMetadata): void;
/**
* Updates a single X, maximum, upperQuartile, median, lowerQuartile, minimum value by X-index. Might also need to set isSorted = false
* @remarks Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
* @param index the index to update
* @param x The new X value
* @param maximum The new maximum value
* @param upperQuartile The new upperQuartile value
* @param median The new median value
* @param lowerQuartile The new lowerQuartile value
* @param minimum The new minimum value
* @param metadata The point metadata
*/
updateXBoxPlot(index: number, x: number, maximum: number, upperQuartile: number, median: number, lowerQuartile: number, minimum: number, metadata?: IPointMetadata): void;
/**
* Inserts a single Date, maximum, upperQuartile, median, lowerQuartile, minimum value at the X-index
* @remarks Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
* @param startIndex the index to insert at
* @param x the X-value (date) encoded as a Unix Timestamp
* @param maximum The maximum value
* @param upperQuartile The upperQuartile value
* @param median The median value
* @param lowerQuartile The lowerQuartile value
* @param minimum The minimum value
* @param metadata The point metadata
*/
insert(startIndex: number, x: number, maximum: number, upperQuartile: number, median: number, lowerQuartile: number, minimum: number, metadata?: IPointMetadata): void;
/**
* Inserts a range of Date, maximum, upperQuartile, median, lowerQuartile, minimum value at the X-index
* @remarks Any changes of the DataSeries will trigger a redraw on the parent {@link SciChartSurface}
* @param startIndex the index to insert at
* @param xValues the X-values (dates) encoded as a Unix Timestamp
* @param maximumValues The maximum values
* @param upperQuartileValues The upperQuartile values
* @param medianValues The median values
* @param lowerQuartileValues The lowerQuartile values
* @param minimumValues The minimum values
* @param metadata The array of point metadata
*/
insertRange(startIndex: number, xValues: NumberArray, maximumValues: NumberArray, upperQuartileValues: NumberArray, medianValues: NumberArray, lowerQuartileValues: NumberArray, minimumValues: NumberArray, metadata?: IPointMetadata[]): void;
/** @inheritDoc */
getWindowedYRange(xRange: NumberRange, getPositiveRange: boolean, isXCategoryAxis?: boolean, dataSeriesValueType?: EDataSeriesValueType, yRangeMode?: EYRangeMode): NumberRange;
/** @inheritDoc */
protected getOptions(excludeData?: boolean): IBoxPlotDataSeriesOptions;
private getBoxPlotValues;
}