igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
64 lines (63 loc) • 4.82 kB
JavaScript
/*
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";
var IgxDoughnutChartDefaultTooltipsComponent = /** @class */ /*@__PURE__*/ (function () {
function IgxDoughnutChartDefaultTooltipsComponent(_changeDetectorRef) {
this._changeDetectorRef = _changeDetectorRef;
this.onContentReady = new EventEmitter();
}
IgxDoughnutChartDefaultTooltipsComponent.prototype.ensureDefaultTooltip = function (series) {
if (series.showDefaultTooltip) {
series.tooltipTemplate = this.doughnutSliceTooltip;
}
else {
if (series.tooltipTemplate === this.doughnutSliceTooltip) {
series.tooltipTemplate = null;
}
}
};
IgxDoughnutChartDefaultTooltipsComponent.prototype.getSliceLabel = function (series, item) {
return item[series.labelMemberPath];
};
IgxDoughnutChartDefaultTooltipsComponent.prototype.getValue = function (series, item) {
return item[this.getValueMemberPath(series)];
};
IgxDoughnutChartDefaultTooltipsComponent.prototype.getValueMemberPath = function (series) {
return series.valueMemberPath;
};
IgxDoughnutChartDefaultTooltipsComponent.prototype.getBrush = function (i) {
if (i.slice.background)
return i.slice.background.fill;
return "black";
};
IgxDoughnutChartDefaultTooltipsComponent.register = function () {
TypeRegistrar.registerCons("IgxDoughnutChartDefaultTooltipsComponent", IgxDoughnutChartDefaultTooltipsComponent);
};
IgxDoughnutChartDefaultTooltipsComponent.prototype.ngAfterContentInit = function () {
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: "\n <ng-template #doughnutSliceTooltip let-series=\"series\" let-item=\"item\" let-implementation=\"i\">\n <div class='ui-chart-default-tooltip-content'> \n <span [style.color]=\"getBrush(implementation)\">{{getSliceLabel(series, item)}}</span>\n <br/>\n <span class=\"ui-tooltip-priority\">{{getValueMemberPath(series)}} : {{getValue(series, item)}}</span>\n </div>\n </ng-template>\n ", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush });
return IgxDoughnutChartDefaultTooltipsComponent;
}());
export { 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: "\n <ng-template #doughnutSliceTooltip let-series=\"series\" let-item=\"item\" let-implementation=\"i\">\n <div class='ui-chart-default-tooltip-content'> \n <span [style.color]=\"getBrush(implementation)\">{{getSliceLabel(series, item)}}</span>\n <br/>\n <span class=\"ui-tooltip-priority\">{{getValueMemberPath(series)}} : {{getValue(series, item)}}</span>\n </div>\n </ng-template>\n ",
styles: []
}]
}], ctorParameters: function () { return [{ type: i0.ChangeDetectorRef }]; }, propDecorators: { doughnutSliceTooltip: [{
type: ViewChild,
args: ["doughnutSliceTooltip", { static: true }]
}], onContentReady: [{
type: Output
}] } });