UNPKG

igniteui-react-core

Version:
99 lines (95 loc) 2.74 kB
import { IgrDataLegendSeriesValueInfo } from "./igr-data-legend-series-value-info"; import { DataLegendSeriesContext as DataLegendSeriesContext_internal } from "./DataLegendSeriesContext"; /** * Represent info about series values */ export class IgrDataLegendSeriesContext { createImplementation() { return new DataLegendSeriesContext_internal(); } get nativeElement() { return this._implementation.nativeElement; } /** * @hidden */ get i() { return this._implementation; } onImplementationCreated() { } constructor() { this.mounted = false; this._implementation = this.createImplementation(); this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } _provideImplementation(i) { this._implementation = i; this._implementation.externalObject = this; this.onImplementationCreated(); if (this._initializeAdapters) { this._initializeAdapters(); } } /** * 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 IgrDataLegendSeriesValueInfo(); 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); } }