UNPKG

igniteui-angular-charts

Version:

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

147 lines (146 loc) 5.97 kB
import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core'; import { IgxSeriesComponent } from "./igx-series-component"; import { TrendLineType, TrendLineType_$type } from "igniteui-angular-core"; import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component"; import { TrendLineLayer } from "./TrendLineLayer"; import { ensureEnum } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Represents the class of the value overlay. The value overlay is a line or circle representing a value on an axis. */ export class IgxTrendLineLayerComponent extends IgxAnnotationLayerComponent { createImplementation() { return new TrendLineLayer(); } /** * @hidden */ get i() { return this._implementation; } constructor() { super(); } get isAnnotationLayer() { return this.i.ev; } get isLineOnly() { return this.i.fo; } /** * Gets or sets the series to target this annotation to. */ get targetSeries() { const r = this.i.aav; if (r == null) { return null; } if (!r.externalObject) { let e = IgxSeriesComponent._createFromInternal(r); if (e) { e._implementation = r; } Object.defineProperty(r, 'externalObject', { value: e, enumerable: false, configurable: true, writable: true }); } return r.externalObject; } set targetSeries(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.aav = null : this.i.aav = v.i; } /** * Gets the actual series being targeted by this annotation. */ get actualTargetSeries() { const r = this.i.aau; if (r == null) { return null; } if (!r.externalObject) { let e = IgxSeriesComponent._createFromInternal(r); if (e) { e._implementation = r; } Object.defineProperty(r, 'externalObject', { value: e, enumerable: false, configurable: true, writable: true }); } return r.externalObject; } set actualTargetSeries(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.aau = null : this.i.aau = v.i; } /** * Gets or sets the trend type for the current series object. */ get trendLineType() { return this.i.aax; } set trendLineType(v) { this.i.aax = ensureEnum(TrendLineType_$type, v); } /** * Gets or sets the trend line period for the target series. * The typical, and initial, value for trend line period is 7. */ get trendLinePeriod() { return this.i.aay; } set trendLinePeriod(v) { this.i.aay = +v; } get isUsableInLegend() { return this.i.isUsableInLegend; } findByName(name) { var baseResult = super.findByName(name); if (baseResult) { return baseResult; } if (this.targetSeries && this.targetSeries.name && this.targetSeries.name == name) { return this.targetSeries; } if (this.actualTargetSeries && this.actualTargetSeries.name && this.actualTargetSeries.name == name) { return this.actualTargetSeries; } return null; } _styling(container, component, parent) { super._styling(container, component, parent); this._inStyling = true; if (this.targetSeries && this.targetSeries._styling) { this.targetSeries._styling(container, component, this); } if (this.actualTargetSeries && this.actualTargetSeries._styling) { this.actualTargetSeries._styling(container, component, this); } this._inStyling = false; } onApplyTemplate() { this.i.ac(); } getManagerIdentifier() { let iv = this.i.aa0(); return (iv); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0-rc.1", ngImport: i0, type: IgxTrendLineLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0-rc.1", type: IgxTrendLineLayerComponent, isStandalone: true, selector: "igx-trend-line-layer", inputs: { targetSeries: "targetSeries", actualTargetSeries: "actualTargetSeries", trendLineType: "trendLineType", trendLinePeriod: "trendLinePeriod" }, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(() => IgxTrendLineLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxTrendLineLayerComponent) }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0-rc.1", ngImport: i0, type: IgxTrendLineLayerComponent, decorators: [{ type: Component, args: [{ selector: 'igx-trend-line-layer', template: ``, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(() => IgxTrendLineLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxTrendLineLayerComponent) }], changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: () => [], propDecorators: { targetSeries: [{ type: Input }], actualTargetSeries: [{ type: Input }], trendLineType: [{ type: Input }], trendLinePeriod: [{ type: Input }] } });