UNPKG

igniteui-angular-charts

Version:

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

98 lines (97 loc) 3.06 kB
import { IgxSeriesComponent } from "./igx-series-component"; import { IgxSeriesMatcher } from "./igx-series-matcher"; import { IgxUserBaseAnnotation } from "./igx-user-base-annotation"; import { UserPointAnnotation as UserPointAnnotation_internal } from "./UserPointAnnotation"; /** * Represents an user annotation for rendering data point annotation on a series */ export class IgxUserPointAnnotation extends IgxUserBaseAnnotation { constructor() { super(); } createImplementation() { return new UserPointAnnotation_internal(); } /** * @hidden */ get i() { return this._implementation; } /** * Gets or sets the target series that will display the annotation. */ get targetSeries() { const r = this.i.targetSeries; if (r == null) { return null; } if (!r.externalObject) { let e = IgxSeriesComponent._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set targetSeries(v) { v == null ? this.i.targetSeries = null : this.i.targetSeries = v.i; } /** * Gets or sets a matcher for matching a series that will display the annotation. */ get targetSeriesMatcher() { const r = this.i.targetSeriesMatcher; if (r == null) { return null; } if (!r.externalObject) { let e = new IgxSeriesMatcher(); if (r.$type) { e._implementation = r; } else { if (e.i.setNativeElement) { e.i.setNativeElement(r); } } r.externalObject = e; } return r.externalObject; } set targetSeriesMatcher(v) { v == null ? this.i.targetSeriesMatcher = null : this.i.targetSeriesMatcher = v.i; } /** * Gets or sets the value that determines location of the annotation in the coordinates of x-axis. */ get xValue() { return this.i.xValue; } set xValue(v) { this.i.xValue = +v; } /** * Gets or sets the value that determines location of the annotation in the coordinates of y-axis. */ get yValue() { return this.i.yValue; } set yValue(v) { this.i.yValue = +v; } 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.targetSeriesMatcher && this.targetSeriesMatcher.name && this.targetSeriesMatcher.name == name) { return this.targetSeriesMatcher; } return null; } }