UNPKG

igniteui-angular-charts

Version:

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

1,471 lines (1,467 loc) 71.1 kB
import { Output, EventEmitter, Component, ViewContainerRef, ViewChild, Input, ChangeDetectionStrategy } from '@angular/core'; import { XamDataLegend } from "./XamDataLegend"; import { arrayFindByName, ensureEnum, brushToString, stringToBrush, ensureBool, toSpinal, initializePropertiesFromCss, NamePatcher } from "igniteui-angular-core"; import { FontInfo } from "igniteui-angular-core"; import { AngularRenderer } from "igniteui-angular-core"; import { delegateCombine } from "igniteui-angular-core"; import { Thickness } from "igniteui-angular-core"; import { DataAbbreviationMode_$type } from "igniteui-angular-core"; import { DataLegendHeaderTimeMode_$type } from "igniteui-angular-core"; import { DataLegendHeaderDateMode_$type } from "igniteui-angular-core"; import { DataLegendUnitsMode_$type } from "igniteui-angular-core"; import { DataLegendLabelMode_$type } from "igniteui-angular-core"; import { DataLegendValueMode_$type } from "igniteui-angular-core"; import { DataLegendLayoutMode_$type } from "igniteui-angular-core"; import { DataLegendSummaryType_$type } from "igniteui-angular-core"; import { IgxDataLegendSummaryEventArgs } from './igx-data-legend-summary-event-args'; import { IgxDataLegendStylingRowEventArgs } from './igx-data-legend-styling-row-event-args'; import { IgxDataLegendStylingColumnEventArgs } from './igx-data-legend-styling-column-event-args'; import { LegendItemBadgeShape_$type } from "igniteui-angular-core"; import * as i0 from "@angular/core"; const DataLegendStylingDefaults = {}; /** * Represents data legend that displays information about each series including values and summaries. */ export let IgxDataLegendComponent = /*@__PURE__*/ (() => { class IgxDataLegendComponent { constructor(renderer, _elRef, ngZone, injector, componentFactoryResolver) { this.renderer = renderer; this._elRef = _elRef; this.ngZone = ngZone; this.injector = injector; this.componentFactoryResolver = componentFactoryResolver; this._wrapper = null; this._root = null; this._implementation = null; this.__p = null; this._hasUserValues = new Set(); this._stylingContainer = null; this._stylingParent = null; this._inStyling = false; this._calculateColumnSummary = null; this._styleHeaderRow = null; this._styleGroupRow = null; this._styleSeriesRow = null; this._styleSummaryRow = null; this._styleSeriesColumn = null; this._styleSummaryColumn = null; this._zoneRunner = null; if (this._styling) { NamePatcher.ensureStylablePatched(Object.getPrototypeOf(this)); } this._implementation = this.createImplementation(); if (renderer) { this.container = renderer.createElement("div"); renderer.appendChild(_elRef.element.nativeElement, this.container); renderer.setStyle(this.container, "display", "block"); renderer.setStyle(this.container, "width", "100%"); renderer.setStyle(this.container, "height", "100%"); } var root; root = this.container; if (this.container != null) { root = this.container; } if (root && root.nativeElement) { root = root.nativeElement; } this._root = root; var dataLegend = this.i; this._dataLegend = dataLegend; this._dataLegend.externalObject = this; if (renderer) { var ren = new AngularRenderer(root, this.renderer, window.document, this.ngZone, true, DataLegendStylingDefaults); this._wrapper = ren; dataLegend.provideContainer(ren); dataLegend.notifySizeChanged(); ren.addSizeWatcher(() => { this._dataLegend.notifySizeChanged(); }); } } set height(value) { this._height = value; this.renderer.setStyle(this._elRef.element.nativeElement, "height", value); this._dataLegend.notifySizeChanged(); } get height() { return this._height; } set width(value) { this._width = value; this.renderer.setStyle(this._elRef.element.nativeElement, "width", value); this._dataLegend.notifySizeChanged(); } get width() { return this._width; } // supports angular themes or custom properties set in CSS updateStyle() { this._styling(this._root, this); } ngOnDestroy() { this._dataLegend.destroy(); this._wrapper.destroy(); } ngAfterContentInit() { this.updateStyle(); } createImplementation() { return new XamDataLegend(); } get i() { return this._implementation; } static _staticStyling(container, component, parent) { let genericPrefix = ""; let typeName = (component.i ? component.i : component).$type.name; if (typeName.indexOf("Xam") === 0) { typeName = typeName.substring(3); } genericPrefix = toSpinal("DataLegend"); let additionalPrefixes = []; let prefix = toSpinal(typeName); additionalPrefixes.push(prefix + "-"); let b = (component.i ? component.i : component).$type.baseType; while (b && b.name != "Object" && b.name != "Base" && b.name != "Control" && b.Name != "DependencyObject" && b.Name != "FrameworkElement") { typeName = b.name; if (typeName.indexOf("Xam") === 0) { typeName = typeName.substring(3); } let basePrefix = toSpinal(typeName); additionalPrefixes.push(basePrefix + "-"); b = b.baseType; } if (parent) { let parentTypeName = parent.i.$type.name; if (parentTypeName.indexOf("Xam") === 0) { parentTypeName = parentTypeName.substring(3); } let parentPrefix = toSpinal(parentTypeName); additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-"); additionalPrefixes.push(parentPrefix + "-" + prefix + "-"); } initializePropertiesFromCss(container, component, genericPrefix + "-", new Set(), false, additionalPrefixes); } /** * Gets or sets the target for the data legend. */ get target() { var ret = this.i.target; if (!ret) { return ret; } if (ret.externalObject != null) { ret = ret.externalObject; } return ret; } set target(v) { if (v && v._implementation) { v = v._implementation; } this.i.target = v; } /** * Gets whether or not at least one badge is visible based on BadgesShape and setting of a row's IsVisble in StyleSeriesRow event */ get actualBadgesVisible() { return this.i.b0; } set actualBadgesVisible(v) { this.i.b0 = ensureBool(v); } /** * Gets the actual pixel scaling ratio used to affect the pixel density of the control. * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control to appear blurry. */ get actualPixelScalingRatio() { return this.i.ct; } set actualPixelScalingRatio(v) { this.i.ct = +v; } /** * Gets the effective background of the data legend. */ get actualBackground() { return brushToString(this.i.i4); } set actualBackground(v) { this.i.i4 = stringToBrush(v); } /** * Gets the effective border brush of the data legend. */ get actualBorderBrush() { return brushToString(this.i.i5); } set actualBorderBrush(v) { this.i.i5 = stringToBrush(v); } get actualBorderThicknessBottom() { return this.i.jr ? this.i.jr.bottom : NaN; } set actualBorderThicknessBottom(v) { this.ensureActualBorderThickness(); this.i.jr.bottom = +v; this.i.jr = this.i.jr; } get actualBorderThicknessLeft() { return this.i.jr ? this.i.jr.left : NaN; } set actualBorderThicknessLeft(v) { this.ensureActualBorderThickness(); this.i.jr.left = +v; this.i.jr = this.i.jr; } get actualBorderThicknessRight() { return this.i.jr ? this.i.jr.right : NaN; } set actualBorderThicknessRight(v) { this.ensureActualBorderThickness(); this.i.jr.right = +v; this.i.jr = this.i.jr; } get actualBorderThicknessTop() { return this.i.jr ? this.i.jr.top : NaN; } set actualBorderThicknessTop(v) { this.ensureActualBorderThickness(); this.i.jr.top = +v; this.i.jr = this.i.jr; } ensureActualBorderThickness() { if (this.i.jr) { return; } this.i.jr = new Thickness(2); } /** * Gets or sets whether the legend is embedded in a DataTooltip */ get isEmbeddedInDataTooltip() { return this.i.isEmbeddedInDataTooltip; } set isEmbeddedInDataTooltip(v) { this.i.isEmbeddedInDataTooltip = ensureBool(v); } /** * Gets or sets indexes, titles, or names of series to include in displaying in the data legend, e.g. "0, 1" or "Series1 Title, Series2 Title" * The ExcludedSeries property takes precedence over values of IncludedSeries property */ get includedSeries() { return this.i.includedSeries; } set includedSeries(v) { if (v && !Array.isArray(v) && typeof (v) == "string") { const re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.includedSeries = v; } /** * Gets or sets indexes, titles, or names of series to exclude from displaying in the data legend, e.g. "0, 1" or "Series1 Title, Series2 Title" * The ExcludedSeries property takes precedence over values of IncludedSeries property */ get excludedSeries() { return this.i.excludedSeries; } set excludedSeries(v) { if (v && !Array.isArray(v) && typeof (v) == "string") { const re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.excludedSeries = v; } /** * Gets or sets names of data columns or their labels to include in displaying in the data legend, e.g. "High, Low" or "H, L" * The ExcludedColumns property takes precedence over values of IncludedColumns property */ get includedColumns() { return this.i.includedColumns; } set includedColumns(v) { if (v && !Array.isArray(v) && typeof (v) == "string") { const re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.includedColumns = v; } /** * Gets or sets names of data columns or their labels to exclude from displaying in the data legend, e.g. "High, Low" or "H, L" * The ExcludedColumns property takes precedence over values of IncludedColumns property */ get excludedColumns() { return this.i.excludedColumns; } set excludedColumns(v) { if (v && !Array.isArray(v) && typeof (v) == "string") { const re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.excludedColumns = v; } /** * Gets or sets whether the data legend should update when the series data is mutated. */ get shouldUpdateWhenSeriesDataChanges() { return this.i.b9; } set shouldUpdateWhenSeriesDataChanges(v) { this.i.b9 = ensureBool(v); } /** * Gets or sets mode for abbreviating large numbers displayed in the legend * This property is ignored when setting ValueFormatSpecifiers or ValueFormatString properties */ get valueFormatAbbreviation() { return this.i.an; } set valueFormatAbbreviation(v) { this.i.an = ensureEnum(DataAbbreviationMode_$type, v); } /** * Gets or sets maximum digits for formatting numbers displayed in the legend * This property is ignored when setting ValueFormatSpecifiers or ValueFormatString properties */ get valueFormatMaxFractions() { return this.i.c0; } set valueFormatMaxFractions(v) { this.i.c0 = +v; } /** * Gets or sets minimum digits for formatting numbers displayed in the legend * This property is ignored when setting ValueFormatSpecifiers or ValueFormatString properties */ get valueFormatMinFractions() { return this.i.c1; } set valueFormatMinFractions(v) { this.i.c1 = +v; } /** * Gets or sets the mode for displaying values in the data legend, e.g. Currency ($500.25), Decimal (500.25), Integer (500) */ get valueFormatMode() { return this.i.a5; } set valueFormatMode(v) { this.i.a5 = ensureEnum(DataLegendValueMode_$type, v); } /** * Gets or sets globalization culture when displaying values as currencies, e.g. use "en-GB" to display British pound symbol when the ValueFormatMode property is set to 'Currency' mode * This property is ignored when setting ValueFormatSpecifiers or ValueFormatString properties */ get valueFormatCulture() { return this.i.fg; } set valueFormatCulture(v) { this.i.fg = v; } /** * Gets or sets the currency code used for displaying currency symbol next to values, e.g. USD for $, EUR for € * This property is ignored when setting ValueFormatSpecifiers or ValueFormatString properties */ get valueFormatCurrencyCode() { return this.i.fi; } set valueFormatCurrencyCode(v) { this.i.fi = v; } /** * Gets or sets whether or not use grouping separator, e.g, 15,000 for 15000 * This property is ignored when setting ValueFormatSpecifiers or ValueFormatString properties */ get valueFormatUseGrouping() { return this.i.ca; } set valueFormatUseGrouping(v) { this.i.ca = ensureBool(v); } /** * Gets or sets the format string for values displayed in the data legend. */ get valueFormatString() { return this.i.fo; } set valueFormatString(v) { this.i.fo = v; } /** * Gets or sets the format specifiers to use with the ValueFormatString string. */ get valueFormatSpecifiers() { return this.i.ah; } set valueFormatSpecifiers(v) { if (v && !Array.isArray(v) && typeof (v) == "string") { const re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.ah = v; } get valueRowMarginBottom() { return this.i.j4 ? this.i.j4.bottom : NaN; } set valueRowMarginBottom(v) { this.ensureValueRowMargin(); this.i.j4.bottom = +v; this.i.j4 = this.i.j4; } get valueRowMarginLeft() { return this.i.j4 ? this.i.j4.left : NaN; } set valueRowMarginLeft(v) { this.ensureValueRowMargin(); this.i.j4.left = +v; this.i.j4 = this.i.j4; } get valueRowMarginRight() { return this.i.j4 ? this.i.j4.right : NaN; } set valueRowMarginRight(v) { this.ensureValueRowMargin(); this.i.j4.right = +v; this.i.j4 = this.i.j4; } get valueRowMarginTop() { return this.i.j4 ? this.i.j4.top : NaN; } set valueRowMarginTop(v) { this.ensureValueRowMargin(); this.i.j4.top = +v; this.i.j4 = this.i.j4; } ensureValueRowMargin() { if (this.i.j4) { return; } this.i.j4 = new Thickness(2); } /** * Gets or sets whether to show series rows. */ get valueRowVisible() { return this.i.cb; } set valueRowVisible(v) { this.i.cb = ensureBool(v); } /** * Gets or sets text displayed when data column is missing a value, e.g. "no data" */ get valueTextWhenMissingData() { return this.i.fx; } set valueTextWhenMissingData(v) { this.i.fx = v; } /** * Gets or sets whether to use series colors when displaying values in the legend */ get valueTextUseSeriesColors() { return this.i.cc; } set valueTextUseSeriesColors(v) { this.i.cc = ensureBool(v); } get valueTextMarginBottom() { return this.i.j5 ? this.i.j5.bottom : NaN; } set valueTextMarginBottom(v) { this.ensureValueTextMargin(); this.i.j5.bottom = +v; this.i.j5 = this.i.j5; } get valueTextMarginLeft() { return this.i.j5 ? this.i.j5.left : NaN; } set valueTextMarginLeft(v) { this.ensureValueTextMargin(); this.i.j5.left = +v; this.i.j5 = this.i.j5; } get valueTextMarginRight() { return this.i.j5 ? this.i.j5.right : NaN; } set valueTextMarginRight(v) { this.ensureValueTextMargin(); this.i.j5.right = +v; this.i.j5 = this.i.j5; } get valueTextMarginTop() { return this.i.j5 ? this.i.j5.top : NaN; } set valueTextMarginTop(v) { this.ensureValueTextMargin(); this.i.j5.top = +v; this.i.j5 = this.i.j5; } ensureValueTextMargin() { if (this.i.j5) { return; } this.i.j5 = new Thickness(2); } /** * Gets or sets the units text color. */ get valueTextColor() { return brushToString(this.i.jk); } set valueTextColor(v) { this.i.jk = stringToBrush(v); } /** * Gets or Sets the style to use for the units text. */ get valueTextStyle() { if (this.i.bx == null) { return null; } return this.i.bx.fontString; } set valueTextStyle(v) { let fi = new FontInfo(); fi.fontString = v; this.i.bx = fi; } /** * Gets or sets the format string for header text displayed in the data legend. */ get headerFormatString() { return this.i.dv; } set headerFormatString(v) { this.i.dv = v; } /** * Gets or sets the format specifiers to use with the HeaderFormatString string. */ get headerFormatSpecifiers() { return this.i.ag; } set headerFormatSpecifiers(v) { if (v && !Array.isArray(v) && typeof (v) == "string") { const re = /\s*(?:,|\s|$)\s*/gm; v = v.split(re); } this.i.ag = v; } /** * Gets or sets globalization culture applied to header only when it displays dates that are fetched from date/time axes * This property is ignored when setting HeaderFormatSpecifiers or HeaderFormatString properties */ get headerFormatCulture() { return this.i.dr; } set headerFormatCulture(v) { this.i.dr = v; } /** * Gets or sets date format for the header only when it displays dates that are fetched from date/time axes * This property is ignored when setting HeaderFormatSpecifiers or HeaderFormatString properties */ get headerFormatDate() { return this.i.ap; } set headerFormatDate(v) { this.i.ap = ensureEnum(DataLegendHeaderDateMode_$type, v); } /** * Gets or sets time format for the header only when it displays dates that are fetched from date/time axes * This property is ignored when setting HeaderFormatSpecifiers or HeaderFormatString properties */ get headerFormatTime() { return this.i.aq; } set headerFormatTime(v) { this.i.aq = ensureEnum(DataLegendHeaderTimeMode_$type, v); } /** * Gets or sets the HeaderText for the data legend. */ get headerText() { return this.i.d0; } set headerText(v) { this.i.d0 = v; } /** * Gets or sets the header text color. */ get headerTextColor() { return brushToString(this.i.jb); } set headerTextColor(v) { this.i.jb = stringToBrush(v); } get headerTextMarginBottom() { return this.i.jx ? this.i.jx.bottom : NaN; } set headerTextMarginBottom(v) { this.ensureHeaderTextMargin(); this.i.jx.bottom = +v; this.i.jx = this.i.jx; } get headerTextMarginLeft() { return this.i.jx ? this.i.jx.left : NaN; } set headerTextMarginLeft(v) { this.ensureHeaderTextMargin(); this.i.jx.left = +v; this.i.jx = this.i.jx; } get headerTextMarginRight() { return this.i.jx ? this.i.jx.right : NaN; } set headerTextMarginRight(v) { this.ensureHeaderTextMargin(); this.i.jx.right = +v; this.i.jx = this.i.jx; } get headerTextMarginTop() { return this.i.jx ? this.i.jx.top : NaN; } set headerTextMarginTop(v) { this.ensureHeaderTextMargin(); this.i.jx.top = +v; this.i.jx = this.i.jx; } ensureHeaderTextMargin() { if (this.i.jx) { return; } this.i.jx = new Thickness(2); } get headerRowMarginBottom() { return this.i.jw ? this.i.jw.bottom : NaN; } set headerRowMarginBottom(v) { this.ensureHeaderRowMargin(); this.i.jw.bottom = +v; this.i.jw = this.i.jw; } get headerRowMarginLeft() { return this.i.jw ? this.i.jw.left : NaN; } set headerRowMarginLeft(v) { this.ensureHeaderRowMargin(); this.i.jw.left = +v; this.i.jw = this.i.jw; } get headerRowMarginRight() { return this.i.jw ? this.i.jw.right : NaN; } set headerRowMarginRight(v) { this.ensureHeaderRowMargin(); this.i.jw.right = +v; this.i.jw = this.i.jw; } get headerRowMarginTop() { return this.i.jw ? this.i.jw.top : NaN; } set headerRowMarginTop(v) { this.ensureHeaderRowMargin(); this.i.jw.top = +v; this.i.jw = this.i.jw; } ensureHeaderRowMargin() { if (this.i.jw) { return; } this.i.jw = new Thickness(2); } /** * Gets or sets whether to show Header row. */ get headerRowVisible() { return this.i.b5; } set headerRowVisible(v) { this.i.b5 = ensureBool(v); } /** * Gets or Sets the style to use for the header text. */ get headerTextStyle() { if (this.i.bp == null) { return null; } return this.i.bp.fontString; } set headerTextStyle(v) { let fi = new FontInfo(); fi.fontString = v; this.i.bp = fi; } /** * Gets or sets whether to show Header row. */ get groupRowVisible() { return this.i.b3; } set groupRowVisible(v) { this.i.b3 = ensureBool(v); } /** * Gets or sets the Group text color. */ get groupTextColor() { return brushToString(this.i.ja); } set groupTextColor(v) { this.i.ja = stringToBrush(v); } get groupTextMarginBottom() { return this.i.jv ? this.i.jv.bottom : NaN; } set groupTextMarginBottom(v) { this.ensureGroupTextMargin(); this.i.jv.bottom = +v; this.i.jv = this.i.jv; } get groupTextMarginLeft() { return this.i.jv ? this.i.jv.left : NaN; } set groupTextMarginLeft(v) { this.ensureGroupTextMargin(); this.i.jv.left = +v; this.i.jv = this.i.jv; } get groupTextMarginRight() { return this.i.jv ? this.i.jv.right : NaN; } set groupTextMarginRight(v) { this.ensureGroupTextMargin(); this.i.jv.right = +v; this.i.jv = this.i.jv; } get groupTextMarginTop() { return this.i.jv ? this.i.jv.top : NaN; } set groupTextMarginTop(v) { this.ensureGroupTextMargin(); this.i.jv.top = +v; this.i.jv = this.i.jv; } ensureGroupTextMargin() { if (this.i.jv) { return; } this.i.jv = new Thickness(2); } get groupRowMarginBottom() { return this.i.ju ? this.i.ju.bottom : NaN; } set groupRowMarginBottom(v) { this.ensureGroupRowMargin(); this.i.ju.bottom = +v; this.i.ju = this.i.ju; } get groupRowMarginLeft() { return this.i.ju ? this.i.ju.left : NaN; } set groupRowMarginLeft(v) { this.ensureGroupRowMargin(); this.i.ju.left = +v; this.i.ju = this.i.ju; } get groupRowMarginRight() { return this.i.ju ? this.i.ju.right : NaN; } set groupRowMarginRight(v) { this.ensureGroupRowMargin(); this.i.ju.right = +v; this.i.ju = this.i.ju; } get groupRowMarginTop() { return this.i.ju ? this.i.ju.top : NaN; } set groupRowMarginTop(v) { this.ensureGroupRowMargin(); this.i.ju.top = +v; this.i.ju = this.i.ju; } ensureGroupRowMargin() { if (this.i.ju) { return; } this.i.ju = new Thickness(2); } /** * Gets or Sets the style to use for the Group text. */ get groupTextStyle() { if (this.i.bo == null) { return null; } return this.i.bo.fontString; } set groupTextStyle(v) { let fi = new FontInfo(); fi.fontString = v; this.i.bo = fi; } /** * Gets or sets the summary text color. */ get summaryTitleTextColor() { return brushToString(this.i.jf); } set summaryTitleTextColor(v) { this.i.jf = stringToBrush(v); } /** * Gets or Sets the style to use for the summary text. */ get summaryTitleTextStyle() { if (this.i.bs == null) { return null; } return this.i.bs.fontString; } set summaryTitleTextStyle(v) { let fi = new FontInfo(); fi.fontString = v; this.i.bs = fi; } /** * Gets or sets the SummaryType for the data legend. */ get summaryType() { return this.i.a3; } set summaryType(v) { this.i.a3 = ensureEnum(DataLegendSummaryType_$type, v); } /** * Gets or sets the SummaryTitleText for the data legend. */ get summaryTitleText() { return this.i.er; } set summaryTitleText(v) { this.i.er = v; } get summaryTitleTextMarginBottom() { return this.i.j0 ? this.i.j0.bottom : NaN; } set summaryTitleTextMarginBottom(v) { this.ensureSummaryTitleTextMargin(); this.i.j0.bottom = +v; this.i.j0 = this.i.j0; } get summaryTitleTextMarginLeft() { return this.i.j0 ? this.i.j0.left : NaN; } set summaryTitleTextMarginLeft(v) { this.ensureSummaryTitleTextMargin(); this.i.j0.left = +v; this.i.j0 = this.i.j0; } get summaryTitleTextMarginRight() { return this.i.j0 ? this.i.j0.right : NaN; } set summaryTitleTextMarginRight(v) { this.ensureSummaryTitleTextMargin(); this.i.j0.right = +v; this.i.j0 = this.i.j0; } get summaryTitleTextMarginTop() { return this.i.j0 ? this.i.j0.top : NaN; } set summaryTitleTextMarginTop(v) { this.ensureSummaryTitleTextMargin(); this.i.j0.top = +v; this.i.j0 = this.i.j0; } ensureSummaryTitleTextMargin() { if (this.i.j0) { return; } this.i.j0 = new Thickness(2); } get summaryRowMarginBottom() { return this.i.jz ? this.i.jz.bottom : NaN; } set summaryRowMarginBottom(v) { this.ensureSummaryRowMargin(); this.i.jz.bottom = +v; this.i.jz = this.i.jz; } get summaryRowMarginLeft() { return this.i.jz ? this.i.jz.left : NaN; } set summaryRowMarginLeft(v) { this.ensureSummaryRowMargin(); this.i.jz.left = +v; this.i.jz = this.i.jz; } get summaryRowMarginRight() { return this.i.jz ? this.i.jz.right : NaN; } set summaryRowMarginRight(v) { this.ensureSummaryRowMargin(); this.i.jz.right = +v; this.i.jz = this.i.jz; } get summaryRowMarginTop() { return this.i.jz ? this.i.jz.top : NaN; } set summaryRowMarginTop(v) { this.ensureSummaryRowMargin(); this.i.jz.top = +v; this.i.jz = this.i.jz; } ensureSummaryRowMargin() { if (this.i.jz) { return; } this.i.jz = new Thickness(2); } /** * Gets or sets the units text color. */ get summaryValueTextColor() { return brushToString(this.i.jh); } set summaryValueTextColor(v) { this.i.jh = stringToBrush(v); } /** * Gets or Sets the style to use for the units text. */ get summaryValueTextStyle() { if (this.i.bu == null) { return null; } return this.i.bu.fontString; } set summaryValueTextStyle(v) { let fi = new FontInfo(); fi.fontString = v; this.i.bu = fi; } /** * Gets or sets the units text for the data legend. */ get summaryLabelText() { return this.i.em; } set summaryLabelText(v) { this.i.em = v; } /** * Gets or sets the units text color. */ get summaryLabelTextColor() { return brushToString(this.i.je); } set summaryLabelTextColor(v) { this.i.je = stringToBrush(v); } /** * Gets or Sets the style to use for the units text. */ get summaryLabelTextStyle() { if (this.i.br == null) { return null; } return this.i.br.fontString; } set summaryLabelTextStyle(v) { let fi = new FontInfo(); fi.fontString = v; this.i.br = fi; } /** * Gets or sets the units text for the data legend. */ get summaryUnitsText() { return this.i.ex; } set summaryUnitsText(v) { this.i.ex = v; } /** * Gets or sets the units text color. */ get summaryUnitsTextColor() { return brushToString(this.i.jg); } set summaryUnitsTextColor(v) { this.i.jg = stringToBrush(v); } /** * Gets or Sets the style to use for the units text. */ get summaryUnitsTextStyle() { if (this.i.bt == null) { return null; } return this.i.bt.fontString; } set summaryUnitsTextStyle(v) { let fi = new FontInfo(); fi.fontString = v; this.i.bt = fi; } get badgeMarginBottom() { return this.i.js ? this.i.js.bottom : NaN; } set badgeMarginBottom(v) { this.ensureBadgeMargin(); this.i.js.bottom = +v; this.i.js = this.i.js; } get badgeMarginLeft() { return this.i.js ? this.i.js.left : NaN; } set badgeMarginLeft(v) { this.ensureBadgeMargin(); this.i.js.left = +v; this.i.js = this.i.js; } get badgeMarginRight() { return this.i.js ? this.i.js.right : NaN; } set badgeMarginRight(v) { this.ensureBadgeMargin(); this.i.js.right = +v; this.i.js = this.i.js; } get badgeMarginTop() { return this.i.js ? this.i.js.top : NaN; } set badgeMarginTop(v) { this.ensureBadgeMargin(); this.i.js.top = +v; this.i.js = this.i.js; } ensureBadgeMargin() { if (this.i.js) { return; } this.i.js = new Thickness(2); } /** * Gets or sets the BadgeShape for the data legend. */ get badgeShape() { return this.i.ba; } set badgeShape(v) { this.i.ba = ensureEnum(LegendItemBadgeShape_$type, v); } /** * Gets or sets horizontal position (between 0.0 and 1.0) in viewport of the target component */ get targetCursorPositionX() { return this.i.targetCursorPositionX; } set targetCursorPositionX(v) { this.i.targetCursorPositionX = +v; } /** * Gets or sets vertical position (between 0.0 and 1.0) in viewport of the target component */ get targetCursorPositionY() { return this.i.targetCursorPositionY; } set targetCursorPositionY(v) { this.i.targetCursorPositionY = +v; } /** * Gets or sets the UnitsMode for the data legend. */ get unitsDisplayMode() { return this.i.a4; } set unitsDisplayMode(v) { this.i.a4 = ensureEnum(DataLegendUnitsMode_$type, v); } /** * Gets or sets the units text for the data legend. */ get unitsText() { return this.i.fa; } set unitsText(v) { this.i.fa = v; } /** * Gets or sets the units text color. */ get unitsTextColor() { return brushToString(this.i.jj); } set unitsTextColor(v) { this.i.jj = stringToBrush(v); } get unitsTextMarginBottom() { return this.i.j2 ? this.i.j2.bottom : NaN; } set unitsTextMarginBottom(v) { this.ensureUnitsTextMargin(); this.i.j2.bottom = +v; this.i.j2 = this.i.j2; } get unitsTextMarginLeft() { return this.i.j2 ? this.i.j2.left : NaN; } set unitsTextMarginLeft(v) { this.ensureUnitsTextMargin(); this.i.j2.left = +v; this.i.j2 = this.i.j2; } get unitsTextMarginRight() { return this.i.j2 ? this.i.j2.right : NaN; } set unitsTextMarginRight(v) { this.ensureUnitsTextMargin(); this.i.j2.right = +v; this.i.j2 = this.i.j2; } get unitsTextMarginTop() { return this.i.j2 ? this.i.j2.top : NaN; } set unitsTextMarginTop(v) { this.ensureUnitsTextMargin(); this.i.j2.top = +v; this.i.j2 = this.i.j2; } ensureUnitsTextMargin() { if (this.i.j2) { return; } this.i.j2 = new Thickness(2); } /** * Gets or Sets the style to use for the units text. */ get unitsTextStyle() { if (this.i.bw == null) { return null; } return this.i.bw.fontString; } set unitsTextStyle(v) { let fi = new FontInfo(); fi.fontString = v; this.i.bw = fi; } get titleTextMarginBottom() { return this.i.j1 ? this.i.j1.bottom : NaN; } set titleTextMarginBottom(v) { this.ensureTitleTextMargin(); this.i.j1.bottom = +v; this.i.j1 = this.i.j1; } get titleTextMarginLeft() { return this.i.j1 ? this.i.j1.left : NaN; } set titleTextMarginLeft(v) { this.ensureTitleTextMargin(); this.i.j1.left = +v; this.i.j1 = this.i.j1; } get titleTextMarginRight() { return this.i.j1 ? this.i.j1.right : NaN; } set titleTextMarginRight(v) { this.ensureTitleTextMargin(); this.i.j1.right = +v; this.i.j1 = this.i.j1; } get titleTextMarginTop() { return this.i.j1 ? this.i.j1.top : NaN; } set titleTextMarginTop(v) { this.ensureTitleTextMargin(); this.i.j1.top = +v; this.i.j1 = this.i.j1; } ensureTitleTextMargin() { if (this.i.j1) { return; } this.i.j1 = new Thickness(2); } /** * Gets or sets the display text color. */ get titleTextColor() { return brushToString(this.i.ji); } set titleTextColor(v) { this.i.ji = stringToBrush(v); } /** * Gets or Sets the style to use for the display text. */ get titleTextStyle() { if (this.i.bv == null) { return null; } return this.i.bv.fontString; } set titleTextStyle(v) { let fi = new FontInfo(); fi.fontString = v; this.i.bv = fi; } /** * Gets or sets the mode for displaying labels before series values in the data legend, e.g. O: H: L: C: for financial series */ get labelDisplayMode() { return this.i.ar; } set labelDisplayMode(v) { this.i.ar = ensureEnum(DataLegendLabelMode_$type, v); } /** * Gets or sets the units text color. */ get labelTextColor() { return brushToString(this.i.jc); } set labelTextColor(v) { this.i.jc = stringToBrush(v); } get labelTextMarginBottom() { return this.i.jy ? this.i.jy.bottom : NaN; } set labelTextMarginBottom(v) { this.ensureLabelTextMargin(); this.i.jy.bottom = +v; this.i.jy = this.i.jy; } get labelTextMarginLeft() { return this.i.jy ? this.i.jy.left : NaN; } set labelTextMarginLeft(v) { this.ensureLabelTextMargin(); this.i.jy.left = +v; this.i.jy = this.i.jy; } get labelTextMarginRight() { return this.i.jy ? this.i.jy.right : NaN; } set labelTextMarginRight(v) { this.ensureLabelTextMargin(); this.i.jy.right = +v; this.i.jy = this.i.jy; } get labelTextMarginTop() { return this.i.jy ? this.i.jy.top : NaN; } set labelTextMarginTop(v) { this.ensureLabelTextMargin(); this.i.jy.top = +v; this.i.jy = this.i.jy; } ensureLabelTextMargin() { if (this.i.jy) { return; } this.i.jy = new Thickness(2); } /** * Gets or Sets the style to use for the units text. */ get labelTextStyle() { if (this.i.bq == null) { return null; } return this.i.bq.fontString; } set labelTextStyle(v) { let fi = new FontInfo(); fi.fontString = v; this.i.bq = fi; } /** * Gets or sets the scaling value used to affect the pixel density of the control. * A higher scaling ratio will produce crisper visuals at the expense of memory. Lower values will cause the control to appear blurry. */ get pixelScalingRatio() { return this.i.pixelScalingRatio; } set pixelScalingRatio(v) { this.i.pixelScalingRatio = +v; } /** * Gets or sets the layout of content in the data legend */ get layoutMode() { return this.i.as; } set layoutMode(v) { this.i.as = ensureEnum(DataLegendLayoutMode_$type, v); } /** * Gets or sets the background of the data legend. */ get contentBackground() { return brushToString(this.i.i6); } set contentBackground(v) { this.i.i6 = stringToBrush(v); } /** * Gets or sets the border color of the data legend. */ get contentBorderBrush() { return brushToString(this.i.i7); } set contentBorderBrush(v) { this.i.i7 = stringToBrush(v); } /** * Gets or sets the border thickness of the data legend. */ get contentBorderThickness() { return this.i.cw; } set contentBorderThickness(v) { this.i.cw = +v; } findByName(name) { if (this.findEphemera) { if (name && name.indexOf("@@e:") == 0) { return this.findEphemera(name); } } if (this.valueFormatSpecifiers != null && arrayFindByName(this.valueFormatSpecifiers, name)) { return arrayFindByName(this.valueFormatSpecifiers, name); } if (this.headerFormatSpecifiers != null && arrayFindByName(this.headerFormatSpecifiers, name)) { return arrayFindByName(this.headerFormatSpecifiers, name); } return null; } get hasUserValues() { return this._hasUserValues; } __m(propertyName) { if (!this._inStyling) { this._hasUserValues.add(propertyName); } } _styling(container, component, parent) { if (this._inStyling) { return; } this._inStyling = true; this._stylingContainer = container; this._stylingParent = component; let genericPrefix = ""; let typeName = this.i.$type.name; if (typeName.indexOf("Xam") === 0) { typeName = typeName.substring(3); } genericPrefix = toSpinal("DataLegendComponent"); let additionalPrefixes = []; let prefix = toSpinal(typeName); additionalPrefixes.push(prefix + "-"); let b = this.i.$type.baseType; while (b && b.name != "Object" && b.name != "Base" && b.name != "Control" && b.Name != "DependencyObject" && b.Name != "FrameworkElement") { typeName = b.name; if (typeName.indexOf("Xam") === 0) { typeName = typeName.substring(3); } let basePrefix = toSpinal(typeName); additionalPrefixes.push(basePrefix + "-"); b = b.baseType; } if (parent) { let parentTypeName = parent.i.$type.name; if (parentTypeName.indexOf("Xam") === 0) { parentTypeName = parentTypeName.substring(3); } let parentPrefix = toSpinal(parentTypeName); additionalPrefixes.push(parentPrefix + "-" + genericPrefix + "-"); additionalPrefixes.push(parentPrefix + "-" + prefix + "-"); } initializePropertiesFromCss(container, this, genericPrefix + "-", this.hasUserValues, false, additionalPrefixes); if (this._otherStyling) { this._otherStyling(container, component, parent); } this._inStyling = false; } /** * Returns the legend visuals expressed as a serialized string. */ exportSerializedVisualData() { let iv = this.i.exportSerializedVisualData(); return (iv); } /** * Notifies the legend about changes to size */ notifySizeChanged() { this.i.notifySizeChanged(); } /** * Forces any pending refresh to the legend to be finished. */ flush() { this.i.flush(); } getAbbreviatedNumber(number, mode, minDigits, maxDigits) { let iv = this.i.cx(number, ensureEnum(DataAbbreviationMode_$type, mode), minDigits, maxDigits); return (iv); } getAbbreviatedSymbol(number, mode, minDigits, maxDigits) { let iv = this.i.dk(number, ensureEnum(DataAbbreviationMode_$type, mode), minDigits, maxDigits); return (iv); } getAbbreviatedString(number, mode, minDigits, maxDigits) { let iv = this.i.dj(number, ensureEnum(DataAbbreviationMode_$type, mode), minDigits, maxDigits); return (iv); } /** * Event raised when calculating summary value for each column in data legend */ get calculateColumnSummary() { if (this._calculateColumnSummary == null) { this._calculateColumnSummary = new EventEmitter(); this.i.calculateColumnSummary = delegateCombine(this.i.calculateColumnSummary, (o, e) => { this._runInZone(() => { let outerArgs = new IgxDataLegendSummaryEventArgs(); outerArgs._provideImplementation(e); if (this.beforeCalculateColumnSummary) { this.beforeCalculateColumnSummary(this, outerArgs); } this._calculateColumnSummary.emit({ sender: this, args: outerArgs }); }); }); } return this._calculateColumnSummary; } /** * Event raised when styling the header row */ get styleHeaderRow() { if (this._styleHeaderRow == null) { this._styleHeaderRow = new EventEmitter(); this.i.styleHeaderRow = delegateCombine(this.i.styleHeaderRow, (o, e) => { this._runInZone(() => { let outerArgs = new IgxDataLegendStylingRowEventArgs(); outerArgs._provideImplementation(e); if (this.beforeStyleHeaderRow) {