UNPKG

igniteui-react-charts

Version:

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

135 lines (134 loc) 4.01 kB
import { IgrSeries } from "./igr-series"; import { TrendLineType_$type } from "igniteui-react-core"; import { IgrAnnotationLayer } from "./igr-annotation-layer"; import { TrendLineLayer } from "./TrendLineLayer"; import { ensureEnum } from "igniteui-react-core"; /** * Represents the class of the value overlay. The value overlay is a line or circle representing a value on an axis. */ export class IgrTrendLineLayer extends IgrAnnotationLayer { createImplementation() { return new TrendLineLayer(); } /** * @hidden */ get i() { return this._implementation; } constructor(props) { super(props); } get isAnnotationLayer() { return this.i.eu; } get isLineOnly() { return this.i.fl; } /** * Gets or sets the name of the series to target this annotation to. */ get targetSeriesName() { return this.i.aah; } set targetSeriesName(v) { this.i.aah = v; } /** * Gets or sets the series to target this annotation to. */ get targetSeries() { const r = this.i.aab; if (r == null) { return null; } if (!r.externalObject) { let e = IgrSeries._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set targetSeries(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.aab = null : this.i.aab = v.i; } /** * Gets the actual series being targeted by this annotation. */ get actualTargetSeries() { const r = this.i.aaa; if (r == null) { return null; } if (!r.externalObject) { let e = IgrSeries._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set actualTargetSeries(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.aaa = null : this.i.aaa = v.i; } /** * Gets or sets the trend type for the current series object. */ get trendLineType() { return this.i.aad; } set trendLineType(v) { this.i.aad = 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.aae; } set trendLinePeriod(v) { this.i.aae = +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.aag(); return (iv); } }