UNPKG

igniteui-angular-charts

Version:

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

670 lines (669 loc) 25.3 kB
import { __extends } from "tslib"; import { Component, Input } from '@angular/core'; import { PieChartSweepDirection_$type } from "./PieChartSweepDirection"; import { CalloutCollisionMode_$type } from "igniteui-angular-core"; import { LegendEmptyValuesMode_$type } from "igniteui-angular-core"; import { OthersCategoryType_$type } from "igniteui-angular-core"; import { AxisRangeBufferMode_$type } from "./AxisRangeBufferMode"; import { RadialLabelMode_$type } from "igniteui-angular-core"; import { CollisionAvoidanceType_$type } from "./CollisionAvoidanceType"; import { IgxRadialBaseChartComponent } from "./igx-radial-base-chart-component"; import { ensureEnum, brushToString, stringToBrush, ensureBool, arrayFindByName } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Represents a base class for PieBase chart control that can plot scatter data */ var IgxDataPieBaseChartComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgxDataPieBaseChartComponent, _super); function IgxDataPieBaseChartComponent() { return _super.call(this) || this; } Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "sliceLabelFormat", { /** * Gets or sets the label format for the slices. */ get: function () { return this.i.ajs; }, set: function (v) { this.i.ajs = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "sliceLabelFormatSpecifiers", { /** * Gets or sets the format specifiers to use with the labels for the slices. */ get: function () { return this.i.ag6; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.ag6 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "legendSliceLabelFormat", { /** * Gets or sets the label format for the LegendSlices. */ get: function () { return this.i.ajc; }, set: function (v) { this.i.ajc = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "legendSliceLabelFormatSpecifiers", { /** * Gets or sets the format specifiers to use with the labels for the LegendSlices. */ get: function () { return this.i.ag4; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.ag4 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "othersSliceLabelFormat", { /** * Gets or sets the label format for the OthersSlices. */ get: function () { return this.i.ajl; }, set: function (v) { this.i.ajl = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "othersSliceLabelFormatSpecifiers", { /** * Gets or sets the format specifiers to use with the labels for the OthersSlices. */ get: function () { return this.i.ag5; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.ag5 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "legendOthersSliceLabelFormat", { /** * Gets or sets the label format for the LegendOthersSlices. */ get: function () { return this.i.ai8; }, set: function (v) { this.i.ai8 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "legendOthersSliceLabelFormatSpecifiers", { /** * Gets or sets the format specifiers to use with the labels for the LegendOthersSlices. */ get: function () { return this.i.ag3; }, set: function (v) { if (v && !Array.isArray(v) && typeof (v) == "string") { var re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.ag3 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "innerExtent", { /** * Defines the percentage of the maximum radius extent to leave blank at the center of the chart. Should be * a value between 0.0 and 1.0. */ get: function () { return this.i.aid; }, set: function (v) { this.i.aid = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "sweepDirection", { /** * Defines the percentage of the maximum radius extent to leave blank at the center of the chart. Should be * a value between 0.0 and 1.0. */ get: function () { return this.i.ahk; }, set: function (v) { this.i.ahk = ensureEnum(PieChartSweepDirection_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "sliceLabelPositionMode", { /** * Defines the positioning mode of the slice labels for the pie chart. */ get: function () { return this.i.aha; }, set: function (v) { this.i.aha = ensureEnum(CalloutCollisionMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "lightSliceLabelColor", { /** * Gets or sets the light color to use for slice labels. */ get: function () { return brushToString(this.i.akk); }, set: function (v) { this.i.akk = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "darkSliceLabelColor", { /** * Gets or sets the Dark color to use for slice labels. */ get: function () { return brushToString(this.i.akj); }, set: function (v) { this.i.akj = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "valueMemberPath", { /** * Gets or sets the overridden value member path to use. */ get: function () { return this.i.aj8; }, set: function (v) { this.i.aj8 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "legendLabelMemberPath", { /** * Gets or sets the legend label member path to use. */ get: function () { return this.i.ai6; }, set: function (v) { this.i.ai6 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "legendEmptyValuesMode", { get: function () { return this.i.ahe; }, set: function (v) { this.i.ahe = ensureEnum(LegendEmptyValuesMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "othersCategoryType", { /** * Gets or sets whether to use numeric or percent-based threshold value. */ get: function () { return this.i.ahi; }, set: function (v) { this.i.ahi = ensureEnum(OthersCategoryType_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "othersCategoryThreshold", { /** * Gets or sets the threshold value that determines if slices are grouped into the Others slice. */ get: function () { return this.i.aie; }, set: function (v) { this.i.aie = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "othersCategoryText", { /** * Gets or sets the label of the Others slice. */ get: function () { return this.i.ajh; }, set: function (v) { this.i.ajh = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "labelMemberPath", { /** * Gets or sets the overridden value member path to use. */ get: function () { return this.i.ai3; }, set: function (v) { this.i.ai3 = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "valueAxisFavorLabellingScaleEnd", { /** * Gets or sets whether the axis should favor emitting a label at the end of the scale. */ get: function () { return this.i.ahz; }, set: function (v) { this.i.ahz = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "valueAxisAutoRangeBufferMode", { /** * Gets or sets how the numeric axis will adjust its range buffer to less closely fix the data from the series. */ get: function () { return this.i.ag8; }, set: function (v) { this.i.ag8 = ensureEnum(AxisRangeBufferMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "angleAxisInterval", { /** * Gets or sets the frequency of displayed labels along the X-axis. * Gets or sets the set value is a factor that determines which labels will be hidden. For example, an interval of 2 will display every other label. */ get: function () { return this.i.aib; }, set: function (v) { this.i.aib = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "angleAxisMinorInterval", { /** * Gets or sets the frequency of displayed minor lines along the X-axis. * Gets or sets the set value is a factor that determines how the minor lines will be displayed. */ get: function () { return this.i.aic; }, set: function (v) { this.i.aic = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "valueAxisInterval", { /** * Gets or sets the distance between each label and grid line along the Y-axis. */ get: function () { return this.i.aij; }, set: function (v) { this.i.aij = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "valueAxisIsLogarithmic", { /** * Gets or sets whether the Y-axis should use a logarithmic scale instead of a linear one. * Since log(-1) is imaginary and log(0) is undefined, it is recommended to enable this property only when the Y-axis minimum is greater than zero. */ get: function () { return this.i.ah0; }, set: function (v) { this.i.ah0 = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "valueAxisLogarithmBase", { /** * Gets or sets the base value to use in the log function when mapping the position of data items along the Y-axis. * This property is effective only when ValueAxisIsLogarithmic is true. */ get: function () { return this.i.aio; }, set: function (v) { this.i.aio = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "valueAxisMinimumValue", { /** * Gets or sets the data value corresponding to the minimum value of the Y-axis. */ get: function () { return this.i.ail; }, set: function (v) { this.i.ail = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "valueAxisMaximumValue", { /** * Gets or sets the data value corresponding to the maximum value of the Y-axis. */ get: function () { return this.i.aik; }, set: function (v) { this.i.aik = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "valueAxisMinorInterval", { /** * Gets or sets the frequency of displayed minor lines along the Y-axis. */ get: function () { return this.i.aim; }, set: function (v) { this.i.aim = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "valueAxisActualMinimum", { /** * Gets the current minimum value for the Y-axis. */ get: function () { return this.i.aii; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "valueAxisActualMaximum", { /** * Gets the current maximum value for the Y-axis. */ get: function () { return this.i.aih; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "radiusExtent", { /** * Gets or sets the extent of the chart's radius. Value between 0 and 1. */ get: function () { return this.i.aif; }, set: function (v) { this.i.aif = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "startAngle", { /** * Gets or sets the start angle to use for the pie chart measured in degrees from the positive x axis. */ get: function () { return this.i.aig; }, set: function (v) { this.i.aig = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "sliceLabelContentSeparator", { /** * Gets or sets the label of the Others slice. */ get: function () { return this.i.ajq; }, set: function (v) { this.i.ajq = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "sliceLabelContentMode", { /** * Gets or sets the label of the Others slice. */ get: function () { return this.i.ahq; }, set: function (v) { this.i.ahq = ensureEnum(RadialLabelMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "legendSliceLabelContentMode", { /** * Gets or sets the label of the Others slice. */ get: function () { return this.i.ahp; }, set: function (v) { this.i.ahp = ensureEnum(RadialLabelMode_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "angleAxisFavorLabellingScaleEnd", { /** * Gets or sets whether to favor labelling the end of the scale. */ get: function () { return this.i.ahw; }, set: function (v) { this.i.ahw = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "valueAxisAbbreviateLargeNumbers", { /** * Gets or sets whether the large numbers on the Y-axis labels are abbreviated. */ get: function () { return this.i.ahy; }, set: function (v) { this.i.ahy = ensureBool(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxDataPieBaseChartComponent.prototype, "markerCollision", { /** * Gets or sets collision avoidance between markers on series that support this behaviour. */ get: function () { return this.i.ahc; }, set: function (v) { this.i.ahc = ensureEnum(CollisionAvoidanceType_$type, v); }, enumerable: false, configurable: true }); IgxDataPieBaseChartComponent.prototype.findByName = function (name) { var baseResult = _super.prototype.findByName.call(this, name); if (baseResult) { return baseResult; } if (this.sliceLabelFormatSpecifiers != null && arrayFindByName(this.sliceLabelFormatSpecifiers, name)) { return arrayFindByName(this.sliceLabelFormatSpecifiers, name); } if (this.legendSliceLabelFormatSpecifiers != null && arrayFindByName(this.legendSliceLabelFormatSpecifiers, name)) { return arrayFindByName(this.legendSliceLabelFormatSpecifiers, name); } if (this.othersSliceLabelFormatSpecifiers != null && arrayFindByName(this.othersSliceLabelFormatSpecifiers, name)) { return arrayFindByName(this.othersSliceLabelFormatSpecifiers, name); } if (this.legendOthersSliceLabelFormatSpecifiers != null && arrayFindByName(this.legendOthersSliceLabelFormatSpecifiers, name)) { return arrayFindByName(this.legendOthersSliceLabelFormatSpecifiers, name); } return null; }; IgxDataPieBaseChartComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxDataPieBaseChartComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); IgxDataPieBaseChartComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxDataPieBaseChartComponent, selector: "ng-component", inputs: { sliceLabelFormat: "sliceLabelFormat", sliceLabelFormatSpecifiers: "sliceLabelFormatSpecifiers", legendSliceLabelFormat: "legendSliceLabelFormat", legendSliceLabelFormatSpecifiers: "legendSliceLabelFormatSpecifiers", othersSliceLabelFormat: "othersSliceLabelFormat", othersSliceLabelFormatSpecifiers: "othersSliceLabelFormatSpecifiers", legendOthersSliceLabelFormat: "legendOthersSliceLabelFormat", legendOthersSliceLabelFormatSpecifiers: "legendOthersSliceLabelFormatSpecifiers", innerExtent: "innerExtent", sweepDirection: "sweepDirection", sliceLabelPositionMode: "sliceLabelPositionMode", lightSliceLabelColor: "lightSliceLabelColor", darkSliceLabelColor: "darkSliceLabelColor", valueMemberPath: "valueMemberPath", legendLabelMemberPath: "legendLabelMemberPath", legendEmptyValuesMode: "legendEmptyValuesMode", othersCategoryType: "othersCategoryType", othersCategoryThreshold: "othersCategoryThreshold", othersCategoryText: "othersCategoryText", labelMemberPath: "labelMemberPath", valueAxisFavorLabellingScaleEnd: "valueAxisFavorLabellingScaleEnd", valueAxisAutoRangeBufferMode: "valueAxisAutoRangeBufferMode", angleAxisInterval: "angleAxisInterval", angleAxisMinorInterval: "angleAxisMinorInterval", valueAxisInterval: "valueAxisInterval", valueAxisIsLogarithmic: "valueAxisIsLogarithmic", valueAxisLogarithmBase: "valueAxisLogarithmBase", valueAxisMinimumValue: "valueAxisMinimumValue", valueAxisMaximumValue: "valueAxisMaximumValue", valueAxisMinorInterval: "valueAxisMinorInterval", radiusExtent: "radiusExtent", startAngle: "startAngle", sliceLabelContentSeparator: "sliceLabelContentSeparator", sliceLabelContentMode: "sliceLabelContentMode", legendSliceLabelContentMode: "legendSliceLabelContentMode", angleAxisFavorLabellingScaleEnd: "angleAxisFavorLabellingScaleEnd", valueAxisAbbreviateLargeNumbers: "valueAxisAbbreviateLargeNumbers", markerCollision: "markerCollision" }, usesInheritance: true, ngImport: i0, template: "", isInline: true }); return IgxDataPieBaseChartComponent; }(IgxRadialBaseChartComponent)); export { IgxDataPieBaseChartComponent }; i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxDataPieBaseChartComponent, decorators: [{ type: Component, args: [{ template: "", }] }], ctorParameters: function () { return []; }, propDecorators: { sliceLabelFormat: [{ type: Input }], sliceLabelFormatSpecifiers: [{ type: Input }], legendSliceLabelFormat: [{ type: Input }], legendSliceLabelFormatSpecifiers: [{ type: Input }], othersSliceLabelFormat: [{ type: Input }], othersSliceLabelFormatSpecifiers: [{ type: Input }], legendOthersSliceLabelFormat: [{ type: Input }], legendOthersSliceLabelFormatSpecifiers: [{ type: Input }], innerExtent: [{ type: Input }], sweepDirection: [{ type: Input }], sliceLabelPositionMode: [{ type: Input }], lightSliceLabelColor: [{ type: Input }], darkSliceLabelColor: [{ type: Input }], valueMemberPath: [{ type: Input }], legendLabelMemberPath: [{ type: Input }], legendEmptyValuesMode: [{ type: Input }], othersCategoryType: [{ type: Input }], othersCategoryThreshold: [{ type: Input }], othersCategoryText: [{ type: Input }], labelMemberPath: [{ type: Input }], valueAxisFavorLabellingScaleEnd: [{ type: Input }], valueAxisAutoRangeBufferMode: [{ type: Input }], angleAxisInterval: [{ type: Input }], angleAxisMinorInterval: [{ type: Input }], valueAxisInterval: [{ type: Input }], valueAxisIsLogarithmic: [{ type: Input }], valueAxisLogarithmBase: [{ type: Input }], valueAxisMinimumValue: [{ type: Input }], valueAxisMaximumValue: [{ type: Input }], valueAxisMinorInterval: [{ type: Input }], radiusExtent: [{ type: Input }], startAngle: [{ type: Input }], sliceLabelContentSeparator: [{ type: Input }], sliceLabelContentMode: [{ type: Input }], legendSliceLabelContentMode: [{ type: Input }], angleAxisFavorLabellingScaleEnd: [{ type: Input }], valueAxisAbbreviateLargeNumbers: [{ type: Input }], markerCollision: [{ type: Input }] } });