UNPKG

igniteui-react-charts

Version:

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

254 lines (253 loc) 9.2 kB
import { __extends } from "tslib"; import { delegateCombine, delegateRemove } from "igniteui-react-core"; import { TimeAxisDisplayType_$type } from "./TimeAxisDisplayType"; import { IgrTimeAxisBase } from "./igr-time-axis-base"; import { CategoryDateTimeXAxis } from "./CategoryDateTimeXAxis"; import { ensureBool, ensureEnum } from "igniteui-react-core"; /** * Represents a category-based horizontal X axis that uses a DateTime scale. * * `CategoryDateTimeXAxis` class represents a category-based horizontal X axis that uses a DateTime scale. * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} * width="700px" * height="500px"> * <IgrTimeXAxis name="xAxis" * label="Time" * dateTimeMemberPath="time" /> * </IgrDataChart> * ``` * * ```ts * this.timeXAxis = new IgrTimeXAxis({name: "timeXAxis"}); * this.timeXAxis.title = "Time X Axis"; * this.timeXAxis.dataSource = this.financialData; * this.timeXAxis.dateTimeMemberPath = "Time"; * this.timeXAxis.label = "Date"; * ``` */ var IgrCategoryDateTimeXAxis = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgrCategoryDateTimeXAxis, _super); function IgrCategoryDateTimeXAxis(props) { var _this = _super.call(this, props) || this; _this._actualIntervalChange = null; _this._actualIntervalChange_wrapped = null; _this._actualMinorIntervalChange = null; _this._actualMinorIntervalChange_wrapped = null; return _this; } IgrCategoryDateTimeXAxis.prototype.createImplementation = function () { return new CategoryDateTimeXAxis(); }; Object.defineProperty(IgrCategoryDateTimeXAxis.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); Object.defineProperty(IgrCategoryDateTimeXAxis.prototype, "isContinuous", { /** * Gets if the current axis is a continuous rather than a discrete scale */ get: function () { return this.i.db; }, enumerable: false, configurable: true }); Object.defineProperty(IgrCategoryDateTimeXAxis.prototype, "unevenlySpacedLabels", { /** * Gets or sets whether the axis labels can be unevenly spaced */ get: function () { return this.i.ri; }, set: function (v) { this.i.ri = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrCategoryDateTimeXAxis.prototype, "displayType", { /** * Gets or sets the axis display type. * Continuous display type divides the axis into even intervals, where labels will not necessarily be aligned with data points. * Discrete display type will not use a constant interval, but will align each label with its data point. * * `displayType` property is used for axis display type. * * Continuous display type divides the axis into even intervals, where labels will not necessarily be aligned with data points. Discrete display type will not use a constant interval, but will align each label with its data point. * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} * width="700px" * height="500px"> * <IgrTimeXAxis name="xAxis" label="Date" * dateTimeMemberPath="Date" * displayType ="continuous" /> * </IgrDataChart> * ``` * * ```ts * this.timeXAxis = new IgrTimeXAxis({name: "timeXAxis"}); * this.xAxis.dataTimeMemberPath="date"; * this.xAxis.displayType ="continuous" * ``` */ get: function () { return this.i.rf; }, set: function (v) { this.i.rf = ensureEnum(TimeAxisDisplayType_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrCategoryDateTimeXAxis.prototype, "interval", { /** * Gets or sets the X axis time interval. * * `Interval` property is used to get/sets the frequency of displayed labels. * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} * width="700px" * height="500px"> * <IgrTimeXAxis name="xAxis" * label="Date" * interval={2} * dateTimeMemberPath="Date" /> * </IgrDataChart> * ``` * * ```ts * this.timeXAxis = new IgrTimeXAxis({name: "timeXAxis"}); * This.xAxis.dataTimeMemberPath="date"; * this.xAxis.interval=2 ; * ``` */ get: function () { return this.i.rr; }, set: function (v) { this.i.rr = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrCategoryDateTimeXAxis.prototype, "actualInterval", { /** * Gets the effective value for the current Interval. */ get: function () { return this.i.ro; }, set: function (v) { this.i.ro = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrCategoryDateTimeXAxis.prototype, "minorInterval", { /** * Gets or sets the frequency of displayed minor lines. * The set value is a factor that determines how the minor lines will be displayed. */ get: function () { return this.i.rs; }, set: function (v) { this.i.rs = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrCategoryDateTimeXAxis.prototype, "actualMinorInterval", { /** * Gets the effective value for the current MinorInterval. */ get: function () { return this.i.rp; }, set: function (v) { this.i.rp = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrCategoryDateTimeXAxis.prototype, "isCategoryDateTime", { /** * Gets if the current axis is of category date time axis type */ get: function () { return this.i.c9; }, enumerable: false, configurable: true }); IgrCategoryDateTimeXAxis.prototype.scrollIntoView = function (minimum, maximum) { this.i.rz(minimum, maximum); }; Object.defineProperty(IgrCategoryDateTimeXAxis.prototype, "actualIntervalChange", { get: function () { return this._actualIntervalChange; }, set: function (ev) { var _this = this; if (this._actualIntervalChange_wrapped !== null) { this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualIntervalChange_wrapped); this._actualIntervalChange_wrapped = null; this._actualIntervalChange = null; } this._actualIntervalChange = ev; this._actualIntervalChange_wrapped = function (o, e) { var ext = _this.actualInterval; if (_this.beforeActualIntervalChange) { _this.beforeActualIntervalChange(_this, ext); } if (_this._actualIntervalChange) { _this._actualIntervalChange(_this, ext); } }; this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualIntervalChange_wrapped); }, enumerable: false, configurable: true }); Object.defineProperty(IgrCategoryDateTimeXAxis.prototype, "actualMinorIntervalChange", { get: function () { return this._actualMinorIntervalChange; }, set: function (ev) { var _this = this; if (this._actualMinorIntervalChange_wrapped !== null) { this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualMinorIntervalChange_wrapped); this._actualMinorIntervalChange_wrapped = null; this._actualMinorIntervalChange = null; } this._actualMinorIntervalChange = ev; this._actualMinorIntervalChange_wrapped = function (o, e) { var ext = _this.actualMinorInterval; if (_this.beforeActualMinorIntervalChange) { _this.beforeActualMinorIntervalChange(_this, ext); } if (_this._actualMinorIntervalChange) { _this._actualMinorIntervalChange(_this, ext); } }; this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualMinorIntervalChange_wrapped); }, enumerable: false, configurable: true }); return IgrCategoryDateTimeXAxis; }(IgrTimeAxisBase)); export { IgrCategoryDateTimeXAxis };