UNPKG

igniteui-react-charts

Version:

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

290 lines (284 loc) 9.84 kB
import { delegateCombine, delegateRemove } from "igniteui-react-core"; import { CategoryCollisionMode_$type } from "./CategoryCollisionMode"; import { CategoryTransitionInMode_$type } from "./CategoryTransitionInMode"; import { IgrAssigningCategoryStyleEventArgs } from "./igr-assigning-category-style-event-args"; import { IgrAssigningCategoryMarkerStyleEventArgs } from "./igr-assigning-category-marker-style-event-args"; import { IgrMarkerSeries } from "./igr-marker-series"; import { ensureBool, ensureEnum, toPoint } from "igniteui-react-core"; /** * Represents the base class for IgxDataChartComponent category series. * * `CategorySeries` class represents the base class for IgxDataChartComponent category series. * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} > * * <IgrCategoryXAxis name="xAxis" /> * <IgrNumericYAxis name="yAxis" /> * * <IgrColumnSeries * name="series1" * xAxisName="xAxis" * yAxisName="yAxis" * valueMemberPath="Value"/> * </IgrDataChart> * ``` * * ```ts * this.columnSeries2 = new IgrColumnSeries({ name: "colSeries2" }); * this.columnSeries2.dataSource = this.categoryData; * this.columnSeries2.xAxis = this.categoryXAxis; * this.columnSeries2.yAxis = this.numericYAxis; * this.columnSeries2.xAxisName = "categoryXAxis"; * this.columnSeries2.yAxisName = "numericYAxis"; * this.columnSeries2.valueMemberPath = "RUS"; * ``` */ export class IgrCategorySeries extends IgrMarkerSeries { /** * @hidden */ get i() { return this._implementation; } constructor(props) { super(props); this._assigningCategoryStyle = null; this._assigningCategoryStyle_wrapped = null; this._assigningCategoryMarkerStyle = null; this._assigningCategoryMarkerStyle_wrapped = null; } get hasValueAxis() { return this.i.em; } get isValueAxisInverted() { return this.i.f6; } /** * Gets whether or not this series is Category series */ get isCategory() { return this.i.e0; } /** * Gets or sets whether this category series should allow custom style overrides of its individual visuals. */ get isCustomCategoryStyleAllowed() { return this.i.zv; } set isCustomCategoryStyleAllowed(v) { this.i.zv = ensureBool(v); } /** * Gets or sets whether this category series should allow custom style overrides of its individual marker visuals. */ get isCustomCategoryMarkerStyleAllowed() { return this.i.zu; } set isCustomCategoryMarkerStyleAllowed(v) { this.i.zu = ensureBool(v); } /** * Gets or sets the category collision mode selection behavior to use for the series. */ get categoryCollisionMode() { return this.i.y4; } set categoryCollisionMode(v) { this.i.y4 = ensureEnum(CategoryCollisionMode_$type, v); } /** * Sets or Gets whether to increase marker fidelity for extreme data shapes that have lots of Y variation over short X intervals. * * Set `UseHighMarkerFidelity` when your data has high variation along the y-axis within a short span of this x-axis. * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} > * * <IgrCategoryXAxis name="xAxis" /> * <IgrNumericYAxis name="yAxis" /> * * <IgrColumnSeries * name="series1" * xAxisName="xAxis" * yAxisName="yAxis" * valueMemberPath="Value" * useHighMarkerFidelity="true"/> * </IgrDataChart> * ``` * * ```ts * this.columnSeries2.useHighMarkerFidelity= "true"; * ``` */ get useHighMarkerFidelity() { return this.i.z1; } set useHighMarkerFidelity(v) { this.i.z1 = ensureBool(v); } /** * Gets or sets the method by which to animate the data into the chart when the chart data source is swapped. * Note: Transitions are not currently supported for stacked series. * * `TransitionInMode` controls the direction of the transition-in animation. * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} > * * <IgrCategoryXAxis name="xAxis" /> * <IgrNumericYAxis name="yAxis" /> * * <IgrColumnSeries * name="series1" * xAxisName="xAxis" * yAxisName="yAxis" * valueMemberPath="Value" * transitionInMode="accordionfromRight"/> * </IgrDataChart> * ``` * * ```ts * * this.columnSeries2.transitionInMode= "accordionfromRight"; * ``` */ get transitionInMode() { return this.i.zg; } set transitionInMode(v) { this.i.zg = ensureEnum(CategoryTransitionInMode_$type, v); } /** * Gets or sets whether the series should transition into the plot area when a new data source is assigned. * Note: Transitions are not currently supported for stacked series. * * Set `IsTransitionInEnabled` to true if you want your chart series to animate into position when the chart is loading into view. * * ```ts * this.columnSeries2 = new IgrColumnSeries({ name: "colSeries2" }); * this.columnSeries2.dataSource = this.categoryData; * this.columnSeries2.xAxis = this.categoryXAxis; * this.columnSeries2.yAxis = this.numericYAxis; * this.columnSeries2.xAxisName = "categoryXAxis"; * this.columnSeries2.yAxisName = "numericYAxis"; * this.columnSeries2.valueMemberPath = "RUS"; * this.columnSeries2.isTransitionInEnabled= "true"; * ``` * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} > * * <IgrCategoryXAxis name="xAxis" /> * <IgrNumericYAxis name="yAxis" /> * * <IgrColumnSeries * name="series1" * xAxisName="xAxis" * yAxisName="yAxis" * valueMemberPath="Value" * isTransitionInEnabled="true"/> * </IgrDataChart> * ``` */ get isTransitionInEnabled() { return this.i.zw; } set isTransitionInEnabled(v) { this.i.zw = ensureBool(v); } /** * Returns the offset value for this series if grouped on a category axis. */ getOffsetValue() { let iv = this.i.getOffsetValue(); return (iv); } /** * Returns the width of the category grouping this series is in. */ getCategoryWidth() { let iv = this.i.getCategoryWidth(); return (iv); } /** * Gets the item that is the best match for the specified world coordinates. * @param world * The world coordinates to use. */ getItem(world) { let iv = this.i.kr(toPoint(world)); return (iv); } /** * Gets the index of the item based on world coordinates. * @param world * The world coordinates to use. */ getItemIndex(world) { let iv = this.i.j7(toPoint(world)); return (iv); } /** * Gets the precise item index, if possible, based on the closeness to the previous or next whole integer. If the series cannot provide this information, GetExactItemIndex will return the same integer value as GetItemIndex. * @param world * The world position for which to return the index. */ getExactItemIndex(world) { let iv = this.i.it(toPoint(world)); return (iv); } /** * Event raised when Assigning Category Style */ get assigningCategoryStyle() { return this._assigningCategoryStyle; } set assigningCategoryStyle(ev) { if (this._assigningCategoryStyle_wrapped !== null) { this.i.assigningCategoryStyle = delegateRemove(this.i.assigningCategoryStyle, this._assigningCategoryStyle_wrapped); this._assigningCategoryStyle_wrapped = null; this._assigningCategoryStyle = null; } this._assigningCategoryStyle = ev; this._assigningCategoryStyle_wrapped = (o, e) => { let outerArgs = new IgrAssigningCategoryStyleEventArgs(); outerArgs._provideImplementation(e); if (this.beforeAssigningCategoryStyle) { this.beforeAssigningCategoryStyle(this, outerArgs); } if (this._assigningCategoryStyle) { this._assigningCategoryStyle(this, outerArgs); } }; this.i.assigningCategoryStyle = delegateCombine(this.i.assigningCategoryStyle, this._assigningCategoryStyle_wrapped); ; } /** * Event raised when Assigning Category Marker Style */ get assigningCategoryMarkerStyle() { return this._assigningCategoryMarkerStyle; } set assigningCategoryMarkerStyle(ev) { if (this._assigningCategoryMarkerStyle_wrapped !== null) { this.i.assigningCategoryMarkerStyle = delegateRemove(this.i.assigningCategoryMarkerStyle, this._assigningCategoryMarkerStyle_wrapped); this._assigningCategoryMarkerStyle_wrapped = null; this._assigningCategoryMarkerStyle = null; } this._assigningCategoryMarkerStyle = ev; this._assigningCategoryMarkerStyle_wrapped = (o, e) => { let outerArgs = new IgrAssigningCategoryMarkerStyleEventArgs(); outerArgs._provideImplementation(e); if (this.beforeAssigningCategoryMarkerStyle) { this.beforeAssigningCategoryMarkerStyle(this, outerArgs); } if (this._assigningCategoryMarkerStyle) { this._assigningCategoryMarkerStyle(this, outerArgs); } }; this.i.assigningCategoryMarkerStyle = delegateCombine(this.i.assigningCategoryMarkerStyle, this._assigningCategoryMarkerStyle_wrapped); ; } }