igniteui-webcomponents-charts
Version:
Ignite UI Web Components charting components for building rich data visualizations using TypeScript APIs.
54 lines (53 loc) • 3.18 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 { __makeTemplateObject } from "tslib";
import { TypeRegistrar } from "igniteui-webcomponents-core";
import { html } from "igniteui-webcomponents-core";
var IgcDoughnutChartDefaultTooltipsComponent = /** @class */ /*@__PURE__*/ (function () {
function IgcDoughnutChartDefaultTooltipsComponent() {
var _this = this;
this.doughnutSliceTooltip = function (context) {
return html(templateObject_1 || (templateObject_1 = __makeTemplateObject(["<div class='ui-chart-default-tooltip-content'> \n <span style=\"color: ", "\">", "</span>\n <br/>\n <span class=\"ui-tooltip-priority\">", " : ", "</span>\n </div>"], ["<div class='ui-chart-default-tooltip-content'> \n <span style=\"color: ", "\">", "</span>\n <br/>\n <span class=\"ui-tooltip-priority\">", " : ", "</span>\n </div>"])), _this.getBrush(context.i), _this.getSliceLabel(context.series, context.item), _this.getValueMemberPath(context.series), _this.getValue(context.series, context.item));
};
this.afterContentInit();
}
IgcDoughnutChartDefaultTooltipsComponent.prototype.ensureDefaultTooltip = function (series) {
if (series.showDefaultTooltip) {
series.tooltipTemplate = this.doughnutSliceTooltip;
}
else {
if (series.tooltipTemplate === this.doughnutSliceTooltip) {
series.tooltipTemplate = null;
}
}
};
IgcDoughnutChartDefaultTooltipsComponent.prototype.getSliceLabel = function (series, item) {
return item[series.labelMemberPath];
};
IgcDoughnutChartDefaultTooltipsComponent.prototype.getValue = function (series, item) {
return item[this.getValueMemberPath(series)];
};
IgcDoughnutChartDefaultTooltipsComponent.prototype.getValueMemberPath = function (series) {
return series.valueMemberPath;
};
IgcDoughnutChartDefaultTooltipsComponent.prototype.getBrush = function (i) {
if (i.slice.background)
return i.slice.background.fill;
return "black";
};
IgcDoughnutChartDefaultTooltipsComponent.register = function () {
TypeRegistrar.registerCons("IgcDoughnutChartDefaultTooltipsComponent", IgcDoughnutChartDefaultTooltipsComponent);
};
IgcDoughnutChartDefaultTooltipsComponent.prototype.afterContentInit = function () {
if (this.onContentReady != null) {
this.onContentReady();
}
};
return IgcDoughnutChartDefaultTooltipsComponent;
}());
export { IgcDoughnutChartDefaultTooltipsComponent };
var templateObject_1;