UNPKG

scichart

Version:

Fast WebGL JavaScript Charting Library and Framework

180 lines (179 loc) 8.41 kB
import { GradientParams } from "../../../Core/GradientParams"; import { NumberRange } from "../../../Core/NumberRange"; import { EColumnMode, EColumnYMode } from "../../../types/ColumnMode"; import { EDataPointWidthMode } from "../../../types/DataPointWidthMode"; import { ESeriesType } from "../../../types/SeriesType"; import { TSciChart } from "../../../types/TSciChart"; import { CoordinateCalculatorBase } from "../../Numerics/CoordinateCalculators/CoordinateCalculatorBase"; import { IThemeProvider } from "../../Themes/IThemeProvider"; import { BaseRenderableSeries } from "./BaseRenderableSeries"; import { IHitTestProvider } from "./HitTest/IHitTestProvider"; import { IBaseRenderableSeriesOptions } from "./IBaseRenderableSeriesOptions"; import { IRenderableSeries } from "./IRenderableSeries"; import { IRectangleSeriesDataLabelProviderOptions } from "./DataLabels/RectangleSeriesDataLabelProvider"; import { ICustomTextureOptions } from "../../Drawing/BrushCache"; /** * Options to pass to the {@link FastRectangleRenderableSeries} constructor */ export interface IFastRectangleRenderableSeriesOptions extends IBaseRenderableSeriesOptions { /** * The column fill as an HTML color code */ fill?: string; /** * Sets a value used to calculate the width of rectangles in X direction. * By default the value is treated as data range, since rectangle series do not tend to be evenly spaced. * To specify if the value should be treated as relative, absolute, or based on range use {@link dataPointWidthMode} * Note that Absolute mode does not work well with autoRange due to circularity between the range calculation and the axis layout. */ dataPointWidth?: number; /** * Sets the mode which determines how dataPointWidth in X direction is interpreted. Available values are {@link EDataPointWidthMode}. Default Relative. */ dataPointWidthMode?: EDataPointWidthMode; /** * Sets the fill as a gradient brush */ fillLinearGradient?: GradientParams; /** * Sets the top corner radius, to give the rectangles top rounded corners. Default is 0 */ topCornerRadius?: number; /** * Sets the bottom corner radius, to give the rectangles bottom rounded corners. Default is 0 */ bottomCornerRadius?: number; /** * Options to pass to the DataLabelProvider. Set a style with font and size to enable per-point text for this series. */ dataLabels?: IRectangleSeriesDataLabelProviderOptions; /** * Sets a common y1 value for all rectangles if y1Values are not provided. Default 0 */ defaultY1?: number; /** * This determines how the x values and optional x1 values are interpreted */ columnXMode?: EColumnMode; /** * This determines how the y values and optional y1 values are interpreted */ columnYMode?: EColumnYMode; /** Options that creates a custom texture brush */ customTextureOptions?: ICustomTextureOptions; } export interface IRectangleRenderableSeries extends IRenderableSeries { fill?: string; fillLinearGradient?: GradientParams; columnXMode: EColumnMode; columnYMode: EColumnYMode; defaultY1: number; dataPointWidth: number; getDataPointWidth: (xCoordCalc: CoordinateCalculatorBase, widthFraction: number, widthMode?: EDataPointWidthMode) => number; dataPointWidthMode: EDataPointWidthMode; customTextureOptions: ICustomTextureOptions; } /** * Defines a rectangle-series or JavaScript rectangle chart type in the SciChart's High Performance Real-time * {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts} * @remarks * To add a rectangle series to a {@link SciChartSurface} you need to declare both the {@link FastRectangleRenderableSeries | RenderableSeries} * and a {@link XyNDataSeries | DataSeries}. * * --- * 📚 Docs: {@link https://www.scichart.com/documentation/js/v4/2d-charts/chart-types/fast-rectangle-renderable-series/} */ export declare class FastRectangleRenderableSeries extends BaseRenderableSeries implements IRectangleRenderableSeries { /** @inheritDoc */ readonly type: ESeriesType; protected defaultY1Property: number; private fillProperty; private dataPointWidthProperty; private dataPointWidthModeProperty; private columnXModeProperty; private columnYModeProperty; private topCornerRadiusProperty; private bottomCornerRadiusProperty; private fillLinearGradientProperty; private customTextureOptionsProperty; /** * Creates an instance of the {@link FastRectangleRenderableSeries} * @param webAssemblyContext The {@link TSciChart | SciChart WebAssembly Context} containing * native methods and access to our WebGL2 WebAssembly Drawing Engine * @param options optional parameters of type {@link IFastRectangleRenderableSeriesOptions} applied when constructing the series type * * --- * 📚 Docs: {@link https://www.scichart.com/documentation/js/v4/2d-charts/chart-types/fast-rectangle-renderable-series/} */ constructor(webAssemblyContext: TSciChart, options?: IFastRectangleRenderableSeriesOptions); protected addDrawingProviders(webAssemblyContext: TSciChart, options?: IBaseRenderableSeriesOptions): void; applyTheme(themeProvider: IThemeProvider): void; /** * Gets or Sets a common y1 value for all rectangles if y1Values are not provided. Default 0 */ get defaultY1(): number; set defaultY1(value: number); /** * Gets or Sets fill property */ get fill(): string; set fill(htmlColorCode: string); /** * Gets or sets the fill as a gradient brush */ get fillLinearGradient(): GradientParams; set fillLinearGradient(gradientBrushParams: GradientParams); /** * Gets or Sets how the x values and optional x1 values are interpreted */ get columnXMode(): EColumnMode; set columnXMode(value: EColumnMode); /** * Gets or Sets how the y values and optional y1 values are interpreted */ get columnYMode(): EColumnYMode; set columnYMode(value: EColumnYMode); /** * Gets or Sets a value used to calculate the width of rectangles in X direction. * By default the value is treated as data range, since rectangle series do not tend to be evenly spaced. * To specify if the value should be treated as relative, absolute, or based on range use {@link dataPointWidthMode} * Note that Absolute mode does not work well with autoRange due to circularity between the range calculation and the axis layout. */ get dataPointWidth(): number; set dataPointWidth(dataPointWidth: number); /** * Gets or sets the mode which determines how dataPointWidth in X direction is interpreted. Available values are {@link EDataPointWidthMode}. Default Range. */ get dataPointWidthMode(): EDataPointWidthMode; set dataPointWidthMode(value: EDataPointWidthMode); /** * Gets or sets the top corner radius, to give the rectangles top rounded corners. Default is 0 */ get topCornerRadius(): number; set topCornerRadius(cornerRadius: number); /** * Gets or sets the bottom corner radius, to give the rectangles bottom rounded corners. Default is 0 */ get bottomCornerRadius(): number; set bottomCornerRadius(cornerRadius: number); /** * Gets or sets options to use a custom texture brush */ get customTextureOptions(): ICustomTextureOptions; /** * Gets or sets options to use a custom texture brush */ set customTextureOptions(customTextureOptions: ICustomTextureOptions); /** @inheritDoc */ getXRange(): NumberRange; /** @inheritDoc */ getYRange(xVisibleRange: NumberRange, isXCategoryAxis?: boolean): NumberRange; /** @inheritDoc */ getIndicesRange(xRange: NumberRange, isCategoryData?: boolean): NumberRange; /** @inheritDoc */ resolveAutoColors(index: number, maxSeries: number, theme: IThemeProvider): void; /** @inheritDoc */ toJSON(excludeData?: boolean): import("../../..").TSeriesDefinition; /** @inheritDoc */ protected newHitTestProvider(): IHitTestProvider; }