UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

260 lines (257 loc) 9.65 kB
import { IgRect } from "igniteui-react-core"; import { IgPoint } from "igniteui-react-core"; import { IgrAxis } from './igr-axis'; import { CategoryAxisBase } from './CategoryAxisBase'; import { IIgrAxisProps } from './igr-axis'; /** * Represents the base class for all IgxDataChartComponent category-based axes. * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} > * * <IgrCategoryXAxis name="xAxis" /> * <IgrNumericYAxis name="yAxis" /> * * <IgrColumnSeries * name="series1" * xAxisName="xAxis" * yAxisName="yAxis" * valueMemberPath="Value" /> * </IgrDataChart> * ``` * * ```ts * this.columnSeries1 = new IgrColumnSeries({ name: "colSeries1" }); * this.columnSeries1.dataSource = this.categoryData; * this.columnSeries1.xAxis = this.categoryXAxis; * this.columnSeries1.yAxis = this.numericYAxis; * this.columnSeries1.xAxisName = "categoryXAxis"; * this.columnSeries1.yAxisName = "numericYAxis"; * this.columnSeries1.valueMemberPath = "USA"; * ``` */ export declare abstract class IgrCategoryAxisBase<P extends IIgrCategoryAxisBaseProps = IIgrCategoryAxisBaseProps> extends IgrAxis<P> { constructor(props: P); private _chartLevelData; provideData(data: any[]): void; private updateDataSource; private _dataSource; set dataSource(value: any); get dataSource(): any; /** * @hidden */ get i(): CategoryAxisBase; /** * Gets if the current axis is a continuous rather than a discrete scale */ get isContinuous(): boolean; /** * Checks if the axis is of category axis type */ get isCategory(): boolean; /** * Gets the number of items in the current category axis items source. */ get itemsCount(): number; set itemsCount(v: number); /** * Gets or sets the amount of space between adjacent categories for the current axis object. * The gap is silently clamped to the range [0, 1] when used. * * Use the `Gap` property to configure the spacing between items on a category axis with item spacing. * * A `Gap` of 0 allocates no space between items. A `Gap` of 1 allocates a space between items equal to the width of one item. * * To set the item spacing to 75% the width of one item, set the `Gap` to 0.75, as in this code: * * ```ts * <IgrDataChart * ref={this.onChartRef} * dataSource={this.state.dataSource} > * * <IgrCategoryXAxis name="xAxis" gap={0.4} /> * <IgrNumericYAxis name="yAxis" /> * * <IgrColumnSeries * name="series1" * xAxisName="xAxis" * yAxisName="yAxis" * valueMemberPath="Value" /> * </IgrDataChart> * ``` */ get gap(): number; set gap(v: number); /** * Gets or sets the maximum gap value to allow. This defaults to 1.0. */ get maximumGap(): number; set maximumGap(v: number); /** * Gets or sets the minimum amount of pixels to use for the gap between categories, if possible. */ get minimumGapSize(): number; set minimumGapSize(v: number); /** * Gets or sets the amount of overlap between adjacent categories for the current axis object. * The overlap is silently clamped to the range [-1, 1] when used. * * Use the `Overlap` property to configure the spacing between items on a category axis with item spacing and more than one series. * * An `Overlap` of 0 places grouped items adjacent to each other. An `Overlap` of 1 places grouped items in the same axis space, completely overlapping. An `Overlap` of -1 places a space between grouped items equal to the width of one item. * * To place grouped items with 75% overlap, set the `Overlap` to 0.75, as in this code: * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} > * * <IgrCategoryXAxis name="xAxis" overlap={1} /> * <IgrNumericYAxis name="yAxis" /> * * <IgrColumnSeries * name="series1" * xAxisName="xAxis" * yAxisName="yAxis" * valueMemberPath="Value" * /> * </IgrDataChart> * ``` */ get overlap(): number; set overlap(v: number); /** * Gets or sets whether the category axis should use clustering display mode even if no series are present that would force clustering mode. * * `UseClusteringMode` applies grouping and spacing to a category axis equivalent to the grouping that occurs when grouping series, such as ColumnSeries, are used. * * Try setting it on an axis displaying financial series to adjust the spacing on the left and right sides of the axis: * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} > * * <IgrCategoryXAxis name="xAxis" useClusteringMode={2} /> * <IgrNumericYAxis name="yAxis" /> * * <IgrColumnSeries * name="series1" * xAxisName="xAxis" * yAxisName="yAxis" * valueMemberPath="Value" /> * </IgrDataChart> * ``` */ get useClusteringMode(): boolean; set useClusteringMode(v: boolean); getFullRange(): number[]; getCategoryBoundingBox(point: IgPoint, useInterpolation: boolean, singularWidth: number): IgRect; getCategoryBoundingBoxHelper(point: IgPoint, useInterpolation: boolean, singularWidth: number, isVertical: boolean): IgRect; /** * Unscales a value from screen space into axis space. * @param unscaledValue * The scaled value in screen coordinates to unscale into axis space. */ unscaleValue(unscaledValue: number): number; notifySetItem(index: number, oldItem: any, newItem: any): void; /** * Used to manually notify the axis that the data source has reset or cleared its items. */ notifyClearItems(): void; notifyInsertItem(index: number, newItem: any): void; notifyRemoveItem(index: number, oldItem: any): void; } export interface IIgrCategoryAxisBaseProps extends IIgrAxisProps { name: string; dataSource?: any; /** * Gets the number of items in the current category axis items source. */ itemsCount?: number | string; /** * Gets or sets the amount of space between adjacent categories for the current axis object. * The gap is silently clamped to the range [0, 1] when used. * * Use the `Gap` property to configure the spacing between items on a category axis with item spacing. * * A `Gap` of 0 allocates no space between items. A `Gap` of 1 allocates a space between items equal to the width of one item. * * To set the item spacing to 75% the width of one item, set the `Gap` to 0.75, as in this code: * * ```ts * <IgrDataChart * ref={this.onChartRef} * dataSource={this.state.dataSource} > * * <IgrCategoryXAxis name="xAxis" gap={0.4} /> * <IgrNumericYAxis name="yAxis" /> * * <IgrColumnSeries * name="series1" * xAxisName="xAxis" * yAxisName="yAxis" * valueMemberPath="Value" /> * </IgrDataChart> * ``` */ gap?: number | string; /** * Gets or sets the maximum gap value to allow. This defaults to 1.0. */ maximumGap?: number | string; /** * Gets or sets the minimum amount of pixels to use for the gap between categories, if possible. */ minimumGapSize?: number | string; /** * Gets or sets the amount of overlap between adjacent categories for the current axis object. * The overlap is silently clamped to the range [-1, 1] when used. * * Use the `Overlap` property to configure the spacing between items on a category axis with item spacing and more than one series. * * An `Overlap` of 0 places grouped items adjacent to each other. An `Overlap` of 1 places grouped items in the same axis space, completely overlapping. An `Overlap` of -1 places a space between grouped items equal to the width of one item. * * To place grouped items with 75% overlap, set the `Overlap` to 0.75, as in this code: * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} > * * <IgrCategoryXAxis name="xAxis" overlap={1} /> * <IgrNumericYAxis name="yAxis" /> * * <IgrColumnSeries * name="series1" * xAxisName="xAxis" * yAxisName="yAxis" * valueMemberPath="Value" * /> * </IgrDataChart> * ``` */ overlap?: number | string; /** * Gets or sets whether the category axis should use clustering display mode even if no series are present that would force clustering mode. * * `UseClusteringMode` applies grouping and spacing to a category axis equivalent to the grouping that occurs when grouping series, such as ColumnSeries, are used. * * Try setting it on an axis displaying financial series to adjust the spacing on the left and right sides of the axis: * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} > * * <IgrCategoryXAxis name="xAxis" useClusteringMode={2} /> * <IgrNumericYAxis name="yAxis" /> * * <IgrColumnSeries * name="series1" * xAxisName="xAxis" * yAxisName="yAxis" * valueMemberPath="Value" /> * </IgrDataChart> * ``` */ useClusteringMode?: boolean | string; }