import { IgrAxis } from "./igr-axis";
import { DataToolTipLayerGroupingMode_$type } from "igniteui-react-core";
import { DataTooltipGroupedPositionX_$type } from "igniteui-react-core";
import { DataTooltipGroupedPositionY_$type } from "igniteui-react-core";
import { DataAbbreviationMode_$type } from "igniteui-react-core";
import { DataLegendValueMode_$type } from "igniteui-react-core";
import { DataLegendHeaderDateMode_$type } from "igniteui-react-core";
import { DataLegendHeaderTimeMode_$type } from "igniteui-react-core";
import { DataLegendSummaryType_$type } from "igniteui-react-core";
import { LegendItemBadgeShape_$type } from "igniteui-react-core";
import { DataLegendUnitsMode_$type } from "igniteui-react-core";
import { DataLegendLabelMode_$type } from "igniteui-react-core";
import { IgrAnnotationLayer } from "./igr-annotation-layer";
import { DataToolTipLayer } from "./DataToolTipLayer";
import { ensureBool, ensureEnum, brushToString, stringToBrush, arrayFindByName } from "igniteui-react-core";
import { Thickness } from "igniteui-react-core";
import { FontInfo } from "igniteui-react-core";
/**
 * Represents an annotation layer that displays grouped tooltips with summaries for series.
*/
export class IgrDataToolTipLayer extends IgrAnnotationLayer {
    createImplementation() {
        return new DataToolTipLayer();
    }
    /**
                                 * @hidden
                                 */
    get i() {
        return this._implementation;
    }
    constructor(props) {
        super(props);
    }
    /**
     * Gets whether the series is an annotation layer displayed only when hovering over the chart.
    */
    get isAnnotationHoverLayer() {
        return this.i.d6;
    }
    /**
     * Gets whether the default tooltip behaviors for the chart are disabled if this layer is present.
    */
    get isDefaultTooltipBehaviorDisabled() {
        return this.i.eh;
    }
    /**
     * Gets or sets the Axis to target this annotation to. If null, this annotation layer will not render content.
    */
    get targetAxis() {
        const r = this.i.xb;
        if (r == null) {
            return null;
        }
        if (!r.externalObject) {
            let e = IgrAxis._createFromInternal(r);
            if (e) {
                e._implementation = r;
            }
            r.externalObject = e;
        }
        return r.externalObject;
    }
    set targetAxis(v) {
        if (v != null && this._stylingContainer && v._styling)
            v._styling(this._stylingContainer, this, this);
        v == null ? this.i.xb = null : this.i.xb = v.i;
    }
    /**
     * Gets or sets whether to use value interpolation when drawing the tooltips.
    */
    get useInterpolation() {
        return this.i.yp;
    }
    set useInterpolation(v) {
        this.i.yp = ensureBool(v);
    }
    /**
     * Gets or sets the grouping mode to apply to use for the tooltip layer.
    */
    get groupingMode() {
        return this.i.xt;
    }
    set groupingMode(v) {
        this.i.xt = ensureEnum(DataToolTipLayerGroupingMode_$type, v);
    }
    /**
     * Gets the actual resolved tooltip layer grouping mode.
    */
    get actualGroupingMode() {
        return this.i.xs;
    }
    set actualGroupingMode(v) {
        this.i.xs = ensureEnum(DataToolTipLayerGroupingMode_$type, v);
    }
    /**
     * Gets or sets the offset of the tooltip layer on the X axis.
    */
    get positionOffsetX() {
        return this.i.yy;
    }
    set positionOffsetX(v) {
        this.i.yy = +v;
    }
    /**
     * Gets or sets the offset of the tooltip layer on the Y axis.
    */
    get positionOffsetY() {
        return this.i.yz;
    }
    set positionOffsetY(v) {
        this.i.yz = +v;
    }
    /**
     * Gets or sets the default offset of the tooltip layer on the X axis.
    */
    get defaultPositionOffsetX() {
        return this.i.yw;
    }
    set defaultPositionOffsetX(v) {
        this.i.yw = +v;
    }
    /**
     * Gets or sets the default offset of the tooltip layer on the Y axis.
    */
    get defaultPositionOffsetY() {
        return this.i.yx;
    }
    set defaultPositionOffsetY(v) {
        this.i.yx = +v;
    }
    /**
     * Gets or sets the tooltip position mode on the X axis for grouped series.
    */
    get groupedPositionModeX() {
        return this.i.xl;
    }
    set groupedPositionModeX(v) {
        this.i.xl = ensureEnum(DataTooltipGroupedPositionX_$type, v);
    }
    /**
     * Gets the actual resolved tooltip position mode on the X axis for grouped series.
    */
    get actualGroupedPositionModeX() {
        return this.i.xk;
    }
    set actualGroupedPositionModeX(v) {
        this.i.xk = ensureEnum(DataTooltipGroupedPositionX_$type, v);
    }
    /**
     * Gets or sets the tooltip position mode on the Y axis for grouped series.
    */
    get groupedPositionModeY() {
        return this.i.xp;
    }
    set groupedPositionModeY(v) {
        this.i.xp = ensureEnum(DataTooltipGroupedPositionY_$type, v);
    }
    /**
     * Gets the actual resolved tooltip position mode on the Y axis for grouped series.
    */
    get actualGroupedPositionModeY() {
        return this.i.xo;
    }
    set actualGroupedPositionModeY(v) {
        this.i.xo = ensureEnum(DataTooltipGroupedPositionY_$type, v);
    }
    /**
     * Gets or sets whether the data legend should update when the series data is mutated.
    */
    get shouldUpdateWhenSeriesDataChanges() {
        return this.i.yo;
    }
    set shouldUpdateWhenSeriesDataChanges(v) {
        this.i.yo = ensureBool(v);
    }
    /**
     * Gets or sets indexes or names of series to include in displaying in the data legend, e.g. "0, 1"
    */
    get includedSeries() {
        return this.i.w8;
    }
    set includedSeries(v) {
        if (v && !Array.isArray(v) && typeof (v) == "string") {
            const re = /\s*(?:,|\s|$)\s*/gm;
            v = v.split(re);
        }
        this.i.w8 = v;
    }
    /**
     * Gets or sets indexes or names of series to exclude from displaying in the data legend, e.g. "0, 1"
     * The ExcludedSeries property takes precedences over values of IncludedSeries property
    */
    get excludedSeries() {
        return this.i.w3;
    }
    set excludedSeries(v) {
        if (v && !Array.isArray(v) && typeof (v) == "string") {
            const re = /\s*(?:,|\s|$)\s*/gm;
            v = v.split(re);
        }
        this.i.w3 = 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 precedences over values of IncludedColumns property
    */
    get includedColumns() {
        return this.i.w7;
    }
    set includedColumns(v) {
        if (v && !Array.isArray(v) && typeof (v) == "string") {
            const re = /\s*(?:,|\s|$)\s*/gm;
            v = v.split(re);
        }
        this.i.w7 = 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 precedences over values of IncludedColumns property
    */
    get excludedColumns() {
        return this.i.w2;
    }
    set excludedColumns(v) {
        if (v && !Array.isArray(v) && typeof (v) == "string") {
            const re = /\s*(?:,|\s|$)\s*/gm;
            v = v.split(re);
        }
        this.i.w2 = 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.xc;
    }
    set valueFormatAbbreviation(v) {
        this.i.xc = ensureEnum(DataAbbreviationMode_$type, v);
    }
    /**
     * Gets or sets maximum digits for formating numbers displayed in the legend
     * This property is ignored when setting ValueFormatSpecifiers or ValueFormatString properties
    */
    get valueFormatMaxFractions() {
        return this.i.zy;
    }
    set valueFormatMaxFractions(v) {
        this.i.zy = +v;
    }
    /**
     * Gets or sets minimum digits for formating numbers displayed in the legend
     * This property is ignored when setting ValueFormatSpecifiers or ValueFormatString properties
    */
    get valueFormatMinFractions() {
        return this.i.zz;
    }
    set valueFormatMinFractions(v) {
        this.i.zz = +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.xi;
    }
    set valueFormatMode(v) {
        this.i.xi = 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.abt;
    }
    set valueFormatCulture(v) {
        this.i.abt = 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.yq;
    }
    set valueFormatUseGrouping(v) {
        this.i.yq = ensureBool(v);
    }
    /**
     * Gets or sets the format string for values displayed in the data legend.
    */
    get valueFormatString() {
        return this.i.abz;
    }
    set valueFormatString(v) {
        this.i.abz = v;
    }
    /**
     * Gets or sets the format specifiers to use with the ValueFormatString string.
    */
    get valueFormatSpecifiers() {
        return this.i.w9;
    }
    set valueFormatSpecifiers(v) {
        if (v && !Array.isArray(v) && typeof (v) == "string") {
            const re = /\s*(?:,|\s|$)\s*/gm;
            v = v.split(re);
        }
        this.i.w9 = v;
    }
    get valueRowMarginBottom() {
        return this.i.aeq ? this.i.aeq.bottom : NaN;
    }
    set valueRowMarginBottom(v) {
        this.ensureValueRowMargin();
        this.i.aeq.bottom = +v;
        this.i.aeq = this.i.aeq;
    }
    get valueRowMarginLeft() {
        return this.i.aeq ? this.i.aeq.left : NaN;
    }
    set valueRowMarginLeft(v) {
        this.ensureValueRowMargin();
        this.i.aeq.left = +v;
        this.i.aeq = this.i.aeq;
    }
    get valueRowMarginRight() {
        return this.i.aeq ? this.i.aeq.right : NaN;
    }
    set valueRowMarginRight(v) {
        this.ensureValueRowMargin();
        this.i.aeq.right = +v;
        this.i.aeq = this.i.aeq;
    }
    get valueRowMarginTop() {
        return this.i.aeq ? this.i.aeq.top : NaN;
    }
    set valueRowMarginTop(v) {
        this.ensureValueRowMargin();
        this.i.aeq.top = +v;
        this.i.aeq = this.i.aeq;
    }
    ensureValueRowMargin() {
        if (this.i.aeq) {
            return;
        }
        this.i.aeq = new Thickness(2);
    }
    /**
     * Gets or sets whether to show series rows.
    */
    get valueRowVisible() {
        return this.i.yr;
    }
    set valueRowVisible(v) {
        this.i.yr = ensureBool(v);
    }
    /**
     * Gets or sets text displayed when data column is missing a value, e.g. "no data"
    */
    get valueTextWhenMissingData() {
        return this.i.ab8;
    }
    set valueTextWhenMissingData(v) {
        this.i.ab8 = v;
    }
    /**
     * Gets or sets whether to use series colors when displaying values in the legend
    */
    get valueTextUseSeriesColors() {
        return this.i.ys;
    }
    set valueTextUseSeriesColors(v) {
        this.i.ys = ensureBool(v);
    }
    get valueTextMarginBottom() {
        return this.i.aer ? this.i.aer.bottom : NaN;
    }
    set valueTextMarginBottom(v) {
        this.ensureValueTextMargin();
        this.i.aer.bottom = +v;
        this.i.aer = this.i.aer;
    }
    get valueTextMarginLeft() {
        return this.i.aer ? this.i.aer.left : NaN;
    }
    set valueTextMarginLeft(v) {
        this.ensureValueTextMargin();
        this.i.aer.left = +v;
        this.i.aer = this.i.aer;
    }
    get valueTextMarginRight() {
        return this.i.aer ? this.i.aer.right : NaN;
    }
    set valueTextMarginRight(v) {
        this.ensureValueTextMargin();
        this.i.aer.right = +v;
        this.i.aer = this.i.aer;
    }
    get valueTextMarginTop() {
        return this.i.aer ? this.i.aer.top : NaN;
    }
    set valueTextMarginTop(v) {
        this.ensureValueTextMargin();
        this.i.aer.top = +v;
        this.i.aer = this.i.aer;
    }
    ensureValueTextMargin() {
        if (this.i.aer) {
            return;
        }
        this.i.aer = new Thickness(2);
    }
    /**
     * Gets or sets the units text color.
    */
    get valueTextColor() {
        return brushToString(this.i.aeb);
    }
    set valueTextColor(v) {
        this.i.aeb = stringToBrush(v);
    }
    /**
     * Gets or Sets the style to use for the units text.
    */
    get valueTextStyle() {
        if (this.i.yf == null) {
            return null;
        }
        return this.i.yf.fontString;
    }
    set valueTextStyle(v) {
        let fi = new FontInfo();
        fi.fontString = v;
        this.i.yf = fi;
    }
    /**
     * Gets or sets the format string for header text displayed in the data legend.
    */
    get headerFormatString() {
        return this.i.aah;
    }
    set headerFormatString(v) {
        this.i.aah = v;
    }
    /**
     * Gets or sets the format specifiers to use with the HeaderFormatString string.
    */
    get headerFormatSpecifiers() {
        return this.i.w6;
    }
    set headerFormatSpecifiers(v) {
        if (v && !Array.isArray(v) && typeof (v) == "string") {
            const re = /\s*(?:,|\s|$)\s*/gm;
            v = v.split(re);
        }
        this.i.w6 = v;
    }
    /**
     * Gets or sets globalization culture when displaying header as date time
     * This property is ignored when setting HeaderFormatSpecifiers or HeaderFormatString properties
    */
    get headerFormatCulture() {
        return this.i.aad;
    }
    set headerFormatCulture(v) {
        this.i.aad = v;
    }
    /**
     * Gets or sets date format for the header
     * This property is ignored when setting HeaderFormatSpecifiers or HeaderFormatString properties
    */
    get headerFormatDate() {
        return this.i.xd;
    }
    set headerFormatDate(v) {
        this.i.xd = ensureEnum(DataLegendHeaderDateMode_$type, v);
    }
    /**
     * Gets or sets time format for the header
     * This property is ignored when setting HeaderFormatSpecifiers or HeaderFormatString properties
    */
    get headerFormatTime() {
        return this.i.xe;
    }
    set headerFormatTime(v) {
        this.i.xe = ensureEnum(DataLegendHeaderTimeMode_$type, v);
    }
    /**
     * Gets or sets the HeaderText for the data legend.
    */
    get headerText() {
        return this.i.aam;
    }
    set headerText(v) {
        this.i.aam = v;
    }
    /**
     * Gets or sets the header text color.
    */
    get headerTextColor() {
        return brushToString(this.i.ad3);
    }
    set headerTextColor(v) {
        this.i.ad3 = stringToBrush(v);
    }
    get headerTextMarginBottom() {
        return this.i.aek ? this.i.aek.bottom : NaN;
    }
    set headerTextMarginBottom(v) {
        this.ensureHeaderTextMargin();
        this.i.aek.bottom = +v;
        this.i.aek = this.i.aek;
    }
    get headerTextMarginLeft() {
        return this.i.aek ? this.i.aek.left : NaN;
    }
    set headerTextMarginLeft(v) {
        this.ensureHeaderTextMargin();
        this.i.aek.left = +v;
        this.i.aek = this.i.aek;
    }
    get headerTextMarginRight() {
        return this.i.aek ? this.i.aek.right : NaN;
    }
    set headerTextMarginRight(v) {
        this.ensureHeaderTextMargin();
        this.i.aek.right = +v;
        this.i.aek = this.i.aek;
    }
    get headerTextMarginTop() {
        return this.i.aek ? this.i.aek.top : NaN;
    }
    set headerTextMarginTop(v) {
        this.ensureHeaderTextMargin();
        this.i.aek.top = +v;
        this.i.aek = this.i.aek;
    }
    ensureHeaderTextMargin() {
        if (this.i.aek) {
            return;
        }
        this.i.aek = new Thickness(2);
    }
    get headerRowMarginBottom() {
        return this.i.aej ? this.i.aej.bottom : NaN;
    }
    set headerRowMarginBottom(v) {
        this.ensureHeaderRowMargin();
        this.i.aej.bottom = +v;
        this.i.aej = this.i.aej;
    }
    get headerRowMarginLeft() {
        return this.i.aej ? this.i.aej.left : NaN;
    }
    set headerRowMarginLeft(v) {
        this.ensureHeaderRowMargin();
        this.i.aej.left = +v;
        this.i.aej = this.i.aej;
    }
    get headerRowMarginRight() {
        return this.i.aej ? this.i.aej.right : NaN;
    }
    set headerRowMarginRight(v) {
        this.ensureHeaderRowMargin();
        this.i.aej.right = +v;
        this.i.aej = this.i.aej;
    }
    get headerRowMarginTop() {
        return this.i.aej ? this.i.aej.top : NaN;
    }
    set headerRowMarginTop(v) {
        this.ensureHeaderRowMargin();
        this.i.aej.top = +v;
        this.i.aej = this.i.aej;
    }
    ensureHeaderRowMargin() {
        if (this.i.aej) {
            return;
        }
        this.i.aej = new Thickness(2);
    }
    /**
     * Gets or sets whether to show Header row.
    */
    get headerRowVisible() {
        return this.i.yh;
    }
    set headerRowVisible(v) {
        this.i.yh = ensureBool(v);
    }
    /**
     * Gets or Sets the style to use for the header text.
    */
    get headerTextStyle() {
        if (this.i.x7 == null) {
            return null;
        }
        return this.i.x7.fontString;
    }
    set headerTextStyle(v) {
        let fi = new FontInfo();
        fi.fontString = v;
        this.i.x7 = fi;
    }
    /**
     * Gets or sets the summary text color.
    */
    get summaryTitleTextColor() {
        return brushToString(this.i.ad6);
    }
    set summaryTitleTextColor(v) {
        this.i.ad6 = stringToBrush(v);
    }
    /**
     * Gets or Sets the style to use for the summary text.
    */
    get summaryTitleTextStyle() {
        if (this.i.ya == null) {
            return null;
        }
        return this.i.ya.fontString;
    }
    set summaryTitleTextStyle(v) {
        let fi = new FontInfo();
        fi.fontString = v;
        this.i.ya = fi;
    }
    /**
     * Gets or sets the SummaryType for the data legend.
    */
    get summaryType() {
        return this.i.xg;
    }
    set summaryType(v) {
        this.i.xg = ensureEnum(DataLegendSummaryType_$type, v);
    }
    /**
     * Gets or sets the SummaryTitleText for the data legend.
    */
    get summaryTitleText() {
        return this.i.aa5;
    }
    set summaryTitleText(v) {
        this.i.aa5 = v;
    }
    get summaryTitleTextMarginBottom() {
        return this.i.aen ? this.i.aen.bottom : NaN;
    }
    set summaryTitleTextMarginBottom(v) {
        this.ensureSummaryTitleTextMargin();
        this.i.aen.bottom = +v;
        this.i.aen = this.i.aen;
    }
    get summaryTitleTextMarginLeft() {
        return this.i.aen ? this.i.aen.left : NaN;
    }
    set summaryTitleTextMarginLeft(v) {
        this.ensureSummaryTitleTextMargin();
        this.i.aen.left = +v;
        this.i.aen = this.i.aen;
    }
    get summaryTitleTextMarginRight() {
        return this.i.aen ? this.i.aen.right : NaN;
    }
    set summaryTitleTextMarginRight(v) {
        this.ensureSummaryTitleTextMargin();
        this.i.aen.right = +v;
        this.i.aen = this.i.aen;
    }
    get summaryTitleTextMarginTop() {
        return this.i.aen ? this.i.aen.top : NaN;
    }
    set summaryTitleTextMarginTop(v) {
        this.ensureSummaryTitleTextMargin();
        this.i.aen.top = +v;
        this.i.aen = this.i.aen;
    }
    ensureSummaryTitleTextMargin() {
        if (this.i.aen) {
            return;
        }
        this.i.aen = new Thickness(2);
    }
    get summaryRowMarginBottom() {
        return this.i.aem ? this.i.aem.bottom : NaN;
    }
    set summaryRowMarginBottom(v) {
        this.ensureSummaryRowMargin();
        this.i.aem.bottom = +v;
        this.i.aem = this.i.aem;
    }
    get summaryRowMarginLeft() {
        return this.i.aem ? this.i.aem.left : NaN;
    }
    set summaryRowMarginLeft(v) {
        this.ensureSummaryRowMargin();
        this.i.aem.left = +v;
        this.i.aem = this.i.aem;
    }
    get summaryRowMarginRight() {
        return this.i.aem ? this.i.aem.right : NaN;
    }
    set summaryRowMarginRight(v) {
        this.ensureSummaryRowMargin();
        this.i.aem.right = +v;
        this.i.aem = this.i.aem;
    }
    get summaryRowMarginTop() {
        return this.i.aem ? this.i.aem.top : NaN;
    }
    set summaryRowMarginTop(v) {
        this.ensureSummaryRowMargin();
        this.i.aem.top = +v;
        this.i.aem = this.i.aem;
    }
    ensureSummaryRowMargin() {
        if (this.i.aem) {
            return;
        }
        this.i.aem = new Thickness(2);
    }
    /**
     * Gets or sets the units text color.
    */
    get summaryValueTextColor() {
        return brushToString(this.i.ad8);
    }
    set summaryValueTextColor(v) {
        this.i.ad8 = stringToBrush(v);
    }
    /**
     * Gets or Sets the style to use for the units text.
    */
    get summaryValueTextStyle() {
        if (this.i.yc == null) {
            return null;
        }
        return this.i.yc.fontString;
    }
    set summaryValueTextStyle(v) {
        let fi = new FontInfo();
        fi.fontString = v;
        this.i.yc = fi;
    }
    /**
     * Gets or sets the units text for the data legend.
    */
    get summaryLabelText() {
        return this.i.aa0;
    }
    set summaryLabelText(v) {
        this.i.aa0 = v;
    }
    /**
     * Gets or sets the units text color.
    */
    get summaryLabelTextColor() {
        return brushToString(this.i.ad5);
    }
    set summaryLabelTextColor(v) {
        this.i.ad5 = stringToBrush(v);
    }
    /**
     * Gets or Sets the style to use for the units text.
    */
    get summaryLabelTextStyle() {
        if (this.i.x9 == null) {
            return null;
        }
        return this.i.x9.fontString;
    }
    set summaryLabelTextStyle(v) {
        let fi = new FontInfo();
        fi.fontString = v;
        this.i.x9 = fi;
    }
    /**
     * Gets or sets the units text for the data legend.
    */
    get summaryUnitsText() {
        return this.i.abb;
    }
    set summaryUnitsText(v) {
        this.i.abb = v;
    }
    /**
     * Gets or sets the units text color.
    */
    get summaryUnitsTextColor() {
        return brushToString(this.i.ad7);
    }
    set summaryUnitsTextColor(v) {
        this.i.ad7 = stringToBrush(v);
    }
    /**
     * Gets or Sets the style to use for the units text.
    */
    get summaryUnitsTextStyle() {
        if (this.i.yb == null) {
            return null;
        }
        return this.i.yb.fontString;
    }
    set summaryUnitsTextStyle(v) {
        let fi = new FontInfo();
        fi.fontString = v;
        this.i.yb = fi;
    }
    get badgeMarginBottom() {
        return this.i.aei ? this.i.aei.bottom : NaN;
    }
    set badgeMarginBottom(v) {
        this.ensureBadgeMargin();
        this.i.aei.bottom = +v;
        this.i.aei = this.i.aei;
    }
    get badgeMarginLeft() {
        return this.i.aei ? this.i.aei.left : NaN;
    }
    set badgeMarginLeft(v) {
        this.ensureBadgeMargin();
        this.i.aei.left = +v;
        this.i.aei = this.i.aei;
    }
    get badgeMarginRight() {
        return this.i.aei ? this.i.aei.right : NaN;
    }
    set badgeMarginRight(v) {
        this.ensureBadgeMargin();
        this.i.aei.right = +v;
        this.i.aei = this.i.aei;
    }
    get badgeMarginTop() {
        return this.i.aei ? this.i.aei.top : NaN;
    }
    set badgeMarginTop(v) {
        this.ensureBadgeMargin();
        this.i.aei.top = +v;
        this.i.aei = this.i.aei;
    }
    ensureBadgeMargin() {
        if (this.i.aei) {
            return;
        }
        this.i.aei = new Thickness(2);
    }
    /**
     * Gets or sets the BadgeShape for the data legend.
    */
    get badgeShape() {
        return this.i.xx;
    }
    set badgeShape(v) {
        this.i.xx = ensureEnum(LegendItemBadgeShape_$type, v);
    }
    /**
     * Gets or sets the UnitsMode for the data legend.
    */
    get unitsDisplayMode() {
        return this.i.xh;
    }
    set unitsDisplayMode(v) {
        this.i.xh = ensureEnum(DataLegendUnitsMode_$type, v);
    }
    /**
     * Gets or sets the units text for the data legend.
    */
    get unitsText() {
        return this.i.abm;
    }
    set unitsText(v) {
        this.i.abm = v;
    }
    /**
     * Gets or sets the units text color.
    */
    get unitsTextColor() {
        return brushToString(this.i.aea);
    }
    set unitsTextColor(v) {
        this.i.aea = stringToBrush(v);
    }
    get unitsTextMarginBottom() {
        return this.i.aep ? this.i.aep.bottom : NaN;
    }
    set unitsTextMarginBottom(v) {
        this.ensureUnitsTextMargin();
        this.i.aep.bottom = +v;
        this.i.aep = this.i.aep;
    }
    get unitsTextMarginLeft() {
        return this.i.aep ? this.i.aep.left : NaN;
    }
    set unitsTextMarginLeft(v) {
        this.ensureUnitsTextMargin();
        this.i.aep.left = +v;
        this.i.aep = this.i.aep;
    }
    get unitsTextMarginRight() {
        return this.i.aep ? this.i.aep.right : NaN;
    }
    set unitsTextMarginRight(v) {
        this.ensureUnitsTextMargin();
        this.i.aep.right = +v;
        this.i.aep = this.i.aep;
    }
    get unitsTextMarginTop() {
        return this.i.aep ? this.i.aep.top : NaN;
    }
    set unitsTextMarginTop(v) {
        this.ensureUnitsTextMargin();
        this.i.aep.top = +v;
        this.i.aep = this.i.aep;
    }
    ensureUnitsTextMargin() {
        if (this.i.aep) {
            return;
        }
        this.i.aep = new Thickness(2);
    }
    /**
     * Gets or Sets the style to use for the units text.
    */
    get unitsTextStyle() {
        if (this.i.ye == null) {
            return null;
        }
        return this.i.ye.fontString;
    }
    set unitsTextStyle(v) {
        let fi = new FontInfo();
        fi.fontString = v;
        this.i.ye = fi;
    }
    get titleTextMarginBottom() {
        return this.i.aeo ? this.i.aeo.bottom : NaN;
    }
    set titleTextMarginBottom(v) {
        this.ensureTitleTextMargin();
        this.i.aeo.bottom = +v;
        this.i.aeo = this.i.aeo;
    }
    get titleTextMarginLeft() {
        return this.i.aeo ? this.i.aeo.left : NaN;
    }
    set titleTextMarginLeft(v) {
        this.ensureTitleTextMargin();
        this.i.aeo.left = +v;
        this.i.aeo = this.i.aeo;
    }
    get titleTextMarginRight() {
        return this.i.aeo ? this.i.aeo.right : NaN;
    }
    set titleTextMarginRight(v) {
        this.ensureTitleTextMargin();
        this.i.aeo.right = +v;
        this.i.aeo = this.i.aeo;
    }
    get titleTextMarginTop() {
        return this.i.aeo ? this.i.aeo.top : NaN;
    }
    set titleTextMarginTop(v) {
        this.ensureTitleTextMargin();
        this.i.aeo.top = +v;
        this.i.aeo = this.i.aeo;
    }
    ensureTitleTextMargin() {
        if (this.i.aeo) {
            return;
        }
        this.i.aeo = new Thickness(2);
    }
    /**
     * Gets or sets the display text color.
    */
    get titleTextColor() {
        return brushToString(this.i.ad9);
    }
    set titleTextColor(v) {
        this.i.ad9 = stringToBrush(v);
    }
    /**
     * Gets or Sets the style to use for the display text.
    */
    get titleTextStyle() {
        if (this.i.yd == null) {
            return null;
        }
        return this.i.yd.fontString;
    }
    set titleTextStyle(v) {
        let fi = new FontInfo();
        fi.fontString = v;
        this.i.yd = 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.xf;
    }
    set labelDisplayMode(v) {
        this.i.xf = ensureEnum(DataLegendLabelMode_$type, v);
    }
    /**
     * Gets or sets the units text color.
    */
    get labelTextColor() {
        return brushToString(this.i.ad4);
    }
    set labelTextColor(v) {
        this.i.ad4 = stringToBrush(v);
    }
    get labelTextMarginBottom() {
        return this.i.ael ? this.i.ael.bottom : NaN;
    }
    set labelTextMarginBottom(v) {
        this.ensureLabelTextMargin();
        this.i.ael.bottom = +v;
        this.i.ael = this.i.ael;
    }
    get labelTextMarginLeft() {
        return this.i.ael ? this.i.ael.left : NaN;
    }
    set labelTextMarginLeft(v) {
        this.ensureLabelTextMargin();
        this.i.ael.left = +v;
        this.i.ael = this.i.ael;
    }
    get labelTextMarginRight() {
        return this.i.ael ? this.i.ael.right : NaN;
    }
    set labelTextMarginRight(v) {
        this.ensureLabelTextMargin();
        this.i.ael.right = +v;
        this.i.ael = this.i.ael;
    }
    get labelTextMarginTop() {
        return this.i.ael ? this.i.ael.top : NaN;
    }
    set labelTextMarginTop(v) {
        this.ensureLabelTextMargin();
        this.i.ael.top = +v;
        this.i.ael = this.i.ael;
    }
    ensureLabelTextMargin() {
        if (this.i.ael) {
            return;
        }
        this.i.ael = new Thickness(2);
    }
    /**
     * Gets or Sets the style to use for the units text.
    */
    get labelTextStyle() {
        if (this.i.x8 == null) {
            return null;
        }
        return this.i.x8.fontString;
    }
    set labelTextStyle(v) {
        let fi = new FontInfo();
        fi.fontString = v;
        this.i.x8 = fi;
    }
    findByName(name) {
        var baseResult = super.findByName(name);
        if (baseResult) {
            return baseResult;
        }
        if (this.targetAxis && this.targetAxis.name && this.targetAxis.name == name) {
            return this.targetAxis;
        }
        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;
    }
    _styling(container, component, parent) {
        super._styling(container, component, parent);
        this._inStyling = true;
        if (this.targetAxis && this.targetAxis._styling) {
            this.targetAxis._styling(container, component, this);
        }
        this._inStyling = false;
    }
    /**
     * Hides any tooltips presented by the layer, if any.
    
    */
    hideToolTips() {
        this.i.n9();
    }
    /**
     * Hides any tooltips presented by the layer, if any.
    
    */
    hideToolTipsImmediate() {
        this.i.oa();
    }
}
