UNPKG

igniteui-angular-charts

Version:

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

156 lines (154 loc) 6.25 kB
import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core'; import { IgxAxisComponent } from "./igx-axis-component"; import { CategoryTooltipLayerPosition, CategoryTooltipLayerPosition_$type } from "./CategoryTooltipLayerPosition"; import { IgxAnnotationLayerComponent } from "./igx-annotation-layer-component"; import { IgxSeriesComponent } from "./igx-series-component"; import { CategoryToolTipLayer } from "./CategoryToolTipLayer"; import { ensureBool, ensureEnum, brushToString, stringToBrush } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Represents an annotation layer that displays grouped tooltips for series that use a category axis. */ export class IgxCategoryToolTipLayerComponent extends IgxAnnotationLayerComponent { createImplementation() { return new CategoryToolTipLayer(); } /** * @hidden */ get i() { return this._implementation; } constructor() { super(); } get isToolTipLayer() { return this.i.f8; } /** * Gets whether the series is an annotation layer displayed only when hovering over the chart. */ get isAnnotationHoverLayer() { return this.i.eu; } /** * Gets whether the default tooltip behaviors for the chart are disabled if this layer is present. */ get isDefaultTooltipBehaviorDisabled() { return this.i.e5; } /** * Gets or sets the Axis to target this annotation to. If null, this annotation layer will not render content. */ get targetAxis() { const r = this.i.aau; if (r == null) { return null; } if (!r.externalObject) { let e = IgxAxisComponent._createFromInternal(r); if (e) { e._implementation = r; } Object.defineProperty(r, 'externalObject', { value: e, enumerable: false, configurable: true, writable: true }); } return r.externalObject; } set targetAxis(v) { if (v != null && this._stylingContainer && v._styling) v._styling(this._stylingContainer, this, this); v == null ? this.i.aau = null : this.i.aau = v.i; } /** * Gets or sets whether to use value interpolation when drawing the tooltips. */ get useInterpolation() { return this.i.aay; } set useInterpolation(v) { this.i.aay = ensureBool(v); } /** * Gets or sets the Position to apply to the tooltip containers. */ get toolTipPosition() { return this.i.aav; } set toolTipPosition(v) { this.i.aav = ensureEnum(CategoryTooltipLayerPosition_$type, v); } /** * Gets or sets the background of the tooltip containers. */ get toolTipBackground() { return brushToString(this.i.abe); } set toolTipBackground(v) { this.i.abe = stringToBrush(v); } /** * Gets or sets the border color of the tooltip containers. */ get toolTipBorderBrush() { return brushToString(this.i.abf); } set toolTipBorderBrush(v) { this.i.abf = stringToBrush(v); } /** * Gets or sets the border thickness of the tooltip containers. */ get toolTipBorderThickness() { return this.i.aaz; } set toolTipBorderThickness(v) { this.i.aaz = +v; } findByName(name) { var baseResult = super.findByName(name); if (baseResult) { return baseResult; } if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) { return this.targetAxis; } return null; } _styling(container, component, parent) { super._styling(container, component, parent); this._inStyling = true; if (this.targetAxis && this.targetAxis._styling) { this.targetAxis._styling(container, component, this); } this._inStyling = false; } /** * Hides any tooltips presented by the layer, if any. */ hideToolTips() { this.i.qn(); } static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0-rc.1", ngImport: i0, type: IgxCategoryToolTipLayerComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); } static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0-rc.1", type: IgxCategoryToolTipLayerComponent, isStandalone: true, selector: "igx-category-tool-tip-layer", inputs: { targetAxis: "targetAxis", useInterpolation: "useInterpolation", toolTipPosition: "toolTipPosition", toolTipBackground: "toolTipBackground", toolTipBorderBrush: "toolTipBorderBrush", toolTipBorderThickness: "toolTipBorderThickness" }, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(() => IgxCategoryToolTipLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxCategoryToolTipLayerComponent) }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); } } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0-rc.1", ngImport: i0, type: IgxCategoryToolTipLayerComponent, decorators: [{ type: Component, args: [{ selector: 'igx-category-tool-tip-layer', template: ``, providers: [{ provide: IgxAnnotationLayerComponent, useExisting: forwardRef(() => IgxCategoryToolTipLayerComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxCategoryToolTipLayerComponent) }], changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: () => [], propDecorators: { targetAxis: [{ type: Input }], useInterpolation: [{ type: Input }], toolTipPosition: [{ type: Input }], toolTipBackground: [{ type: Input }], toolTipBorderBrush: [{ type: Input }], toolTipBorderThickness: [{ type: Input }] } });