igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
102 lines (101 loc) • 4.03 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 { __extends } from "tslib";
import { Base, Point_$type, markType } from "igniteui-angular-core";
import { LegendItemHelper } from "igniteui-angular-core";
import { RenderingContext } from "igniteui-angular-core";
import { EllipseGeometry } from "igniteui-angular-core";
import { Path } from "igniteui-angular-core";
import { CanvasViewRenderer } from "igniteui-angular-core";
import { DeviceUtils } from "igniteui-angular-core";
import { isNaN_ } from "igniteui-angular-core";
/**
* @hidden
*/
var PieLegendTemplates = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(PieLegendTemplates, _super);
function PieLegendTemplates() {
return _super !== null && _super.apply(this, arguments) || this;
}
PieLegendTemplates.h = function (a) {
var b = a.data;
var c = b.series;
var d = c.legendItemBadgeTemplate;
var e = b.legendLabel != null ? b.legendLabel : b.itemLabel;
if (e == null) {
e = "Pie Item";
}
LegendItemHelper.c(a.context, a.xPosition, a.yPosition, a.availableWidth, a.availableHeight, a.data, e.toString(), d, a.passInfo);
};
PieLegendTemplates.e = function (a) {
var b = a.data;
var c = b.series;
var d = c.legendItemBadgeTemplate;
var e = b.legendLabel != null ? b.legendLabel : b.itemLabel;
if (e == null) {
e = "Doughnut Item";
}
LegendItemHelper.c(a.context, a.xPosition, a.yPosition, a.availableWidth, a.availableHeight, a.data, e.toString(), d, a.passInfo);
};
PieLegendTemplates.c = function (a) {
};
PieLegendTemplates.f = function (a) {
};
PieLegendTemplates.g = function (a) {
var b = a.data;
var c = a.context;
var d = new RenderingContext(new CanvasViewRenderer(), c);
var e = DeviceUtils.g(9);
var f = DeviceUtils.g(9);
var g = e / 2;
var h = f / 2;
var i = PieLegendTemplates.a(g, e, a.availableWidth);
var j = PieLegendTemplates.b(h, f, a.availableHeight);
var k = new EllipseGeometry();
k.e = { $type: Point_$type, x: i, y: j };
k.c = g;
k.d = h;
var l = new Path();
l.an = k;
l._fill = b.itemBrush;
l._stroke = b.outline;
l.ad = isNaN_(b.thickness) ? 1 : b.thickness;
d.t(l);
};
PieLegendTemplates.d = function (a) {
var b = a.data;
var c = a.context;
var d = new RenderingContext(new CanvasViewRenderer(), c);
var e = DeviceUtils.g(9);
var f = DeviceUtils.g(9);
var g = e / 2;
var h = f / 2;
var i = PieLegendTemplates.a(g, e, a.availableWidth);
var j = PieLegendTemplates.b(h, f, a.availableHeight);
var k = new EllipseGeometry();
k.e = { $type: Point_$type, x: i, y: j };
k.c = g;
k.d = h;
var l = new Path();
l.an = k;
l._fill = b.itemBrush;
l._stroke = b.outline;
l.ad = isNaN_(b.thickness) ? 1 : b.thickness;
d.t(l);
};
PieLegendTemplates.a = function (a, b, c) {
var d = (c - b) / 2;
return a + d;
};
PieLegendTemplates.b = function (a, b, c) {
var d = (c - b) / 2;
return a + d;
};
PieLegendTemplates.$t = markType(PieLegendTemplates, 'PieLegendTemplates');
return PieLegendTemplates;
}(Base));
export { PieLegendTemplates };