UNPKG

igniteui-angular-charts

Version:

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

81 lines (80 loc) 4.46 kB
/* THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE AGREEMENT ("AGREEMENT") LOCATED HERE: https://www.infragistics.com/legal/license/igultimate-la https://www.infragistics.com/legal/license/igultimate-eula GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE: you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company. */ import { Component, EventEmitter, Output, ViewChild, ChangeDetectionStrategy } from '@angular/core'; import { TypeRegistrar } from "igniteui-angular-core"; import * as i0 from "@angular/core"; export let IgxDoughnutChartDefaultTooltipsComponent = /*@__PURE__*/ (() => { class IgxDoughnutChartDefaultTooltipsComponent { constructor(_changeDetectorRef) { this._changeDetectorRef = _changeDetectorRef; this.onContentReady = new EventEmitter(); } ensureDefaultTooltip(series) { if (series.showDefaultTooltip) { series.tooltipTemplate = this.doughnutSliceTooltip; } else { if (series.tooltipTemplate === this.doughnutSliceTooltip) { series.tooltipTemplate = null; } } } getSliceLabel(series, item) { return item[series.labelMemberPath]; } getValue(series, item) { return item[this.getValueMemberPath(series)]; } getValueMemberPath(series) { return series.valueMemberPath; } getBrush(i) { if (i.slice.background) return i.slice.background.fill; return "black"; } static register() { TypeRegistrar.registerCons("IgxDoughnutChartDefaultTooltipsComponent", IgxDoughnutChartDefaultTooltipsComponent); } ngAfterContentInit() { this.onContentReady.emit({}); } } IgxDoughnutChartDefaultTooltipsComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxDoughnutChartDefaultTooltipsComponent, deps: [{ token: i0.ChangeDetectorRef }], target: i0.ɵɵFactoryTarget.Component }); IgxDoughnutChartDefaultTooltipsComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxDoughnutChartDefaultTooltipsComponent, selector: "igx-dougnut-chart-default-tooltips", outputs: { onContentReady: "onContentReady" }, viewQueries: [{ propertyName: "doughnutSliceTooltip", first: true, predicate: ["doughnutSliceTooltip"], descendants: true, static: true }], ngImport: i0, template: ` <ng-template #doughnutSliceTooltip let-series="series" let-item="item" let-implementation="i"> <div class='ui-chart-default-tooltip-content'> <span [style.color]="getBrush(implementation)">{{getSliceLabel(series, item)}}</span> <br/> <span class="ui-tooltip-priority">{{getValueMemberPath(series)}} : {{getValue(series, item)}}</span> </div> </ng-template> `, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); return IgxDoughnutChartDefaultTooltipsComponent; })(); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxDoughnutChartDefaultTooltipsComponent, decorators: [{ type: Component, args: [{ selector: 'igx-dougnut-chart-default-tooltips', changeDetection: ChangeDetectionStrategy.OnPush, template: ` <ng-template #doughnutSliceTooltip let-series="series" let-item="item" let-implementation="i"> <div class='ui-chart-default-tooltip-content'> <span [style.color]="getBrush(implementation)">{{getSliceLabel(series, item)}}</span> <br/> <span class="ui-tooltip-priority">{{getValueMemberPath(series)}} : {{getValue(series, item)}}</span> </div> </ng-template> `, styles: [] }] }], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { doughnutSliceTooltip: [{ type: ViewChild, args: ["doughnutSliceTooltip", { static: true }] }], onContentReady: [{ type: Output }] } });