UNPKG

igniteui-angular-charts

Version:

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

228 lines (227 loc) 5.64 kB
import { brushToString, ensureBool, stringToBrush } from "igniteui-angular-core"; import { TypeRegistrar } from "igniteui-angular-core"; /** * Represents base class for all user annotations, e.g. UserPointAnnotation, UserSliceAnnotation, UserStripAnnotation, UserAxisAnnotation */ export class IgxUserBaseAnnotation { constructor() { this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } createImplementation() { return null; } /** * @hidden */ get i() { return this._implementation; } /** * @hidden */ static _createFromInternal(internal) { if (!internal) { return null; } if (!internal.$type) { return null; } let name = internal.$type.name; let externalName = "Igx" + name + "Component"; if (!TypeRegistrar.isRegistered(externalName)) { return null; } return TypeRegistrar.create(externalName); } _provideImplementation(i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); } onImplementationCreated() { } get identifier() { return this.i.an; } set identifier(v) { this.i.an = v; } /** * Gets or sets the text that should be displayed on axis annotation. */ get label() { return this.i.aq; } set label(v) { this.i.aq = v; } /** * Gets or sets the additional data that should be stored with the annotation. */ get annotationData() { return this.i.ac; } set annotationData(v) { this.i.ac = v; } /** * Gets or sets whether to the annotations is rendered */ get isVisible() { return this.i.s; } set isVisible(v) { this.i.s = ensureBool(v); } /** * Gets or sets the color of text displayed in the annotation. */ get labelColor() { return brushToString(this.i.bo); } set labelColor(v) { this.i.bo = stringToBrush(v); } /** * Gets or sets the background text displayed in the annotation. */ get labelBackground() { return brushToString(this.i.bm); } set labelBackground(v) { this.i.bm = stringToBrush(v); } /** * Gets or sets the border color of the axis annotation. */ get labelBorderColor() { return brushToString(this.i.bn); } set labelBorderColor(v) { this.i.bn = stringToBrush(v); } /** * Gets or sets border thickness of the axis annotations. */ get labelBorderThickness() { return this.i.y; } set labelBorderThickness(v) { this.i.y = +v; } /** * Gets or sets the border radius of the annotation. */ get labelBorderRadius() { return this.i.x; } set labelBorderRadius(v) { this.i.x = +v; } /** * Gets or sets padding around the label in annotation. */ get labelPadding() { return this.i.z; } set labelPadding(v) { this.i.z = +v; } /** * Gets or sets whether to draw the badge in annotation */ get badgeVisible() { return this.i.p; } set badgeVisible(v) { this.i.p = ensureBool(v); } /** * Gets or sets the background of badge annotation. */ get badgeBackground() { return brushToString(this.i.bk); } set badgeBackground(v) { this.i.bk = stringToBrush(v); } /** * Gets or sets the outline of badge annotation. */ get badgeOutline() { return brushToString(this.i.bl); } set badgeOutline(v) { this.i.bl = stringToBrush(v); } /** * Gets or sets thickness of the badge annotations. */ get badgeThickness() { return this.i.w; } set badgeThickness(v) { this.i.w = +v; } /** * Gets or sets size of the badge annotations. */ get badgeSize() { return this.i.v; } set badgeSize(v) { this.i.v = +v; } /** * Gets or sets border radius of the badge annotations. */ get badgeCornerRadius() { return this.i.t; } set badgeCornerRadius(v) { this.i.t = +v; } /** * Gets or sets margin of the badge annotations. */ get badgeMargin() { return this.i.u; } set badgeMargin(v) { this.i.u = +v; } /** * Gets or sets image path for displayed in the badge annotations. */ get badgeImagePath() { return this.i.ag; } set badgeImagePath(v) { this.i.ag = v; } /** * Gets or sets whether the annotation is pill shaped. */ get isPillShaped() { return this.i.r; } set isPillShaped(v) { this.i.r = ensureBool(v); } findByName(name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } return null; } bindAxes(axes) { } bindSeries(series) { } }