UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

205 lines (204 loc) 8.71 kB
import { EventEmitter, Output, Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core'; import { delegateCombine } from "igniteui-angular-core"; import { TimeAxisDisplayType_$type } from "./TimeAxisDisplayType"; import { IgxTimeAxisBaseComponent } from "./igx-time-axis-base-component"; import { IgxCategoryAxisBaseComponent } from "./igx-category-axis-base-component"; import { IgxAxisComponent } from "./igx-axis-component"; import { CategoryDateTimeXAxis } from "./CategoryDateTimeXAxis"; import { ensureBool, ensureEnum } from "igniteui-angular-core"; import * as i0 from "@angular/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. * * ```html * <igx-data-chart * [dataSource]="data"> * <igx-time-x-axis * dateTimeMemberPath="date" * #xAxis> * </igx-time-x-axis> * </igx-data-chart> * ``` * * ```ts * let xAxis = new IgxTimeXAxisComponent(); * xAxis.dataTimeMemberPath="date"; * this.chart.axes.add(xAxis); * ``` */ export let IgxCategoryDateTimeXAxisComponent = /*@__PURE__*/ (() => { class IgxCategoryDateTimeXAxisComponent extends IgxTimeAxisBaseComponent { constructor() { super(); this._actualIntervalChange = null; this._actualMinorIntervalChange = null; } createImplementation() { return new CategoryDateTimeXAxis(); } /** * @hidden */ get i() { return this._implementation; } /** * Gets if the current axis is a continuous rather than a discrete scale */ get isContinuous() { return this.i.di; } /** * Gets or sets whether the axis labels can be unevenly spaced */ get unevenlySpacedLabels() { return this.i.sk; } set unevenlySpacedLabels(v) { this.i.sk = ensureBool(v); } /** * 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. * * ```html * <igx-data-chart * [dataSource]="data"> * <igx-time-x-axis * dateTimeMemberPath="date" * displayType ="continuous" * #xAxis> * </igx-time-x-axis> * </igx-data-chart> * ``` */ get displayType() { return this.i.sh; } set displayType(v) { this.i.sh = ensureEnum(TimeAxisDisplayType_$type, v); } /** * Gets or sets the X axis time interval. * * `Interval` property is used to get/sets the frequency of displayed labels. * * ```html * <igx-data-chart * [dataSource]="data"> * <igx-time-x-axis * dateTimeMemberPath="date" * interval=2 * #xAxis> * </igx-time-x-axis> * </igx-data-chart> * ``` */ get interval() { return this.i.st; } set interval(v) { this.i.st = +v; } /** * Gets the effective value for the current Interval. */ get actualInterval() { return this.i.sq; } set actualInterval(v) { this.i.sq = +v; } /** * 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 minorInterval() { return this.i.su; } set minorInterval(v) { this.i.su = +v; } /** * Gets the effective value for the current MinorInterval. */ get actualMinorInterval() { return this.i.sr; } set actualMinorInterval(v) { this.i.sr = +v; } /** * Gets if the current axis is of category date time axis type */ get isCategoryDateTime() { return this.i.dg; } scrollIntoView(minimum, maximum) { this.i.s1(minimum, maximum); } get actualIntervalChange() { if (this._actualIntervalChange == null) { this._actualIntervalChange = new EventEmitter(); this.i.propertyChanged = delegateCombine(this.i.propertyChanged, (o, e) => { let iv = e; let ext = this.actualInterval; if (this.beforeActualIntervalChange) { this.beforeActualIntervalChange(this, ext); } this._actualIntervalChange.emit(ext); }); } return this._actualIntervalChange; } get actualMinorIntervalChange() { if (this._actualMinorIntervalChange == null) { this._actualMinorIntervalChange = new EventEmitter(); this.i.propertyChanged = delegateCombine(this.i.propertyChanged, (o, e) => { let iv = e; let ext = this.actualMinorInterval; if (this.beforeActualMinorIntervalChange) { this.beforeActualMinorIntervalChange(this, ext); } this._actualMinorIntervalChange.emit(ext); }); } return this._actualMinorIntervalChange; } } IgxCategoryDateTimeXAxisComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxCategoryDateTimeXAxisComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); IgxCategoryDateTimeXAxisComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxCategoryDateTimeXAxisComponent, selector: "igx-category-date-time-x-axis", inputs: { unevenlySpacedLabels: "unevenlySpacedLabels", displayType: "displayType", interval: "interval", actualInterval: "actualInterval", minorInterval: "minorInterval", actualMinorInterval: "actualMinorInterval" }, outputs: { actualIntervalChange: "actualIntervalChange", actualMinorIntervalChange: "actualMinorIntervalChange" }, providers: [{ provide: IgxTimeAxisBaseComponent, useExisting: forwardRef(() => IgxCategoryDateTimeXAxisComponent) }, { provide: IgxCategoryAxisBaseComponent, useExisting: forwardRef(() => IgxCategoryDateTimeXAxisComponent) }, { provide: IgxAxisComponent, useExisting: forwardRef(() => IgxCategoryDateTimeXAxisComponent) }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); return IgxCategoryDateTimeXAxisComponent; })(); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxCategoryDateTimeXAxisComponent, decorators: [{ type: Component, args: [{ selector: 'igx-category-date-time-x-axis', template: ``, providers: [{ provide: IgxTimeAxisBaseComponent, useExisting: forwardRef(() => IgxCategoryDateTimeXAxisComponent) }, { provide: IgxCategoryAxisBaseComponent, useExisting: forwardRef(() => IgxCategoryDateTimeXAxisComponent) }, { provide: IgxAxisComponent, useExisting: forwardRef(() => IgxCategoryDateTimeXAxisComponent) }], changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: function () { return []; }, propDecorators: { unevenlySpacedLabels: [{ type: Input }], displayType: [{ type: Input }], interval: [{ type: Input }], actualInterval: [{ type: Input }], minorInterval: [{ type: Input }], actualMinorInterval: [{ type: Input }], actualIntervalChange: [{ type: Output }], actualMinorIntervalChange: [{ type: Output }] } });