UNPKG

igniteui-angular-core

Version:

Ignite UI Angular Core logic used in multiple UI components.

92 lines (88 loc) 2.63 kB
import { IgxDataLegendSeriesValueInfo } from "./igx-data-legend-series-value-info"; import { DataLegendSeriesContext as DataLegendSeriesContext_internal } from "./DataLegendSeriesContext"; /** * Represent info about series values */ export class IgxDataLegendSeriesContext { constructor() { this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } createImplementation() { return new DataLegendSeriesContext_internal(); } /** * @hidden */ get i() { return this._implementation; } onImplementationCreated() { } _provideImplementation(i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); } /** * Gets a family of series that the current series belongs to, e.g. Category, Range, Financial, etc. */ get seriesFamily() { return this.i.h; } set seriesFamily(v) { this.i.h = v; } findByName(name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } return null; } /** * Creates an instance of DataLegendSeriesContext */ getSeriesValueInfo(type) { let iv = this.i.b((type == null ? null : type)); let ret = null; if (iv && iv.externalObject) { ret = iv.externalObject; } else { if (iv) { let e = new IgxDataLegendSeriesValueInfo(); e._implementation = iv; iv.externalObject = e; ret = e; } } return ret; } /** * Gets value info for the series value type */ getSeriesValue(type) { let iv = this.i.f((type == null ? null : type)); return (iv); } setSeriesValue(type, value) { this.i.k((type == null ? null : type), value); } setSeriesValueInfo(type, valueInfo) { this.i.l((type == null ? null : type), (valueInfo == null ? null : valueInfo.i)); } /** * Gets all values that a series renders at the current data point * For example, Open, High, Low, Close for Financial Series */ getSeriesValues() { let iv = this.i.a(); return (iv); } }