/*
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 * as React from 'react';
import * as ReactDOM from 'react-dom';
import { GridMode_$type } from './GridMode';
import { IgrSeriesViewer } from './igr-series-viewer';
import { ReactRenderer, ReactWrapper } from "igniteui-react-core";
import { TypeRegistrar } from "igniteui-react-core";
import { XamDataChart } from './XamDataChart';
import { CollectionAdapter, brushToString, stringToBrush, ensureBool, ensureEnum, NamePatcher } from "igniteui-react-core";
import { Axis } from './Axis';
import { DataChartStylingDefaults } from './DataChartStylingDefaults';
import { IgrDataContext } from "igniteui-react-core";
import { IgrSeriesCollection } from './igr-series-collection';
import { NotifyCollectionChangedAction } from "igniteui-react-core";
import { IgrAxisCollection } from './igr-axis-collection';
import { ContentChildrenManager } from "igniteui-react-core";
import { SyncLinkManager } from './SyncLinkManager';
import { SyncLink } from './SyncLink';
import { ComputedPlotAreaMarginMode_$type } from './ComputedPlotAreaMarginMode';
import { AutoMarginsAndAngleUpdateMode_$type } from './AutoMarginsAndAngleUpdateMode';
import { SeriesPlotAreaMarginHorizontalMode_$type } from './SeriesPlotAreaMarginHorizontalMode';
import { SeriesPlotAreaMarginVerticalMode_$type } from './SeriesPlotAreaMarginVerticalMode';
/**
 * Represents a chart area containing axes, series, an optional legend and other hosted content.
*/
var IgrDataChart = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(IgrDataChart, _super);
    function IgrDataChart(props) {
        var _this = _super.call(this, props) || this;
        _this.contentAxes = [];
        _this.contentSeries = [];
        /**
         * The series actually present in the chart. Do not directly modify this array.
         * This array's contents can be modified by causing React to reproject the child content.
         * Or adding and removing series from the manual series collection on the series property.
         */
        _this.actualSeries = [];
        /**
         * The axes actually present in the chart. Do not directly modify this array.
         * This array's contents can be modified by causing React to reproject the child content.
         * Or adding and removing axes from the manual axes collection on the axes property.
         */
        _this.actualAxes = [];
        _this._series = null;
        _this._axes = null;
        _this._initialized = false;
        _this._dataSource = null;
        _this._highlightedDataSource = null;
        _this._axesAdapter = null;
        _this._seriesAdapter = null;
        _this._defaultTooltips = null;
        _this._uniqueTooltipId = 0;
        if (_this._styling) {
            NamePatcher.ensureStylablePatched(Object.getPrototypeOf(_this));
        }
        _this._getMainRef = _this._getMainRef.bind(_this);
        _this._tooltipRef = _this._tooltipRef.bind(_this);
        _this._activeTooltipElements = new Map();
        _this._activeTooltips = new Map();
        _this._currentTooltips = [];
        _this._contentChildrenManager = new ContentChildrenManager(function (ch) { return ch.key || ch.props.name; }, function (ch) { return ch.key || ch.props.name; }, function () { return _this._updateContentChildren(); });
        if (document) {
            _this._container = document.createElement("div");
            _this._container.style.display = "block";
            _this._container.style.width = "100%";
            _this._container.style.height = "100%";
        }
        var root;
        root = _this._container;
        var ren = new ReactRenderer(root, document, true, DataChartStylingDefaults);
        _this._wrapper = ren;
        var chart = _this.i;
        _this._chart = chart;
        _this._axesAdapter = new CollectionAdapter(_this.contentAxes, _this.i.axes, _this.actualAxes, function (c) { return c.i; }, function (i) {
            i._provideRenderer(_this._wrapper);
            i.provideData(_this._dataSource);
            for (var j = 0; j < _this.actualSeries.length; j++) {
                _this.actualSeries[j].bindAxes(_this.actualAxes);
            }
            for (var j = 0; j < _this.actualAxes.length; j++) {
                _this.actualAxes[j].bindAxes(_this.actualAxes);
            }
            if (_this._container && _this._container.parentElement) {
                i._styling(_this._container, _this, _this);
            }
            //this._checkCrossing(); 
        }, function (i) { i._provideRenderer(null); i.provideData(null); });
        _this._seriesAdapter = new CollectionAdapter(_this.contentSeries, _this.i.series, _this.actualSeries, function (c) { return c.i; }, function (i) {
            i.owner = _this;
            i._provideRenderer(_this._wrapper);
            i.provideData(_this._dataSource);
            i.provideHighlightedData(_this._highlightedDataSource);
            if (_this._container && _this._container.parentElement) {
                i._styling(_this._container, _this, _this);
            }
            i.bindAxes(_this.actualAxes);
            _this._ensureDefaultTooltip(i);
            _this._ensureTooltipCreated(i);
        }, function (i) { i._provideRenderer(null); i.provideData(null); });
        chart.provideContainer(ren);
        ren.addSizeWatcher(function () {
            _this._chart.notifyContainerResized();
        });
        _this._initialized = true;
        return _this;
    }
    Object.defineProperty(IgrDataChart.prototype, "height", {
        get: function () {
            return this._height;
        },
        set: function (value) {
            this._height = value;
            if (this._elRef) {
                this._elRef.style.height = value;
                this._chart.notifyContainerResized();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "legend", {
        /**
         * Gets or sets the legend used for the current chart.
        */
        get: function () {
            if (this.i.legend != null)
                return this.i.legend.externalObject;
        },
        set: function (v) {
            if (v != undefined && v != null)
                this.i.legend = v.i;
        },
        enumerable: false,
        configurable: true
    });
    IgrDataChart.prototype._updateContentChildren = function () {
        this.contentAxes.length = 0;
        this.contentSeries.length = 0;
        var contentChildrenActual = this._contentChildrenManager.contentChildrenActual;
        for (var i = 0; i < contentChildrenActual.length; i++) {
            if ((Axis.$type).isAssignableFrom(contentChildrenActual[i].i.$type)) {
                this.contentAxes.push(contentChildrenActual[i]);
            }
            else {
                this.contentSeries.push(contentChildrenActual[i]);
            }
        }
        if (this._axesAdapter !== null) {
            this._axesAdapter.notifyContentChanged();
        }
        if (this._seriesAdapter !== null) {
            this._seriesAdapter.notifyContentChanged();
        }
    };
    //private _contentChildrenManager: ContentChildrenManager;
    // private _childrenDiffer(children: any): boolean {
    //     if (this._contentChildren === null) {
    //         return true;
    //     }
    //     if (React.Children.count(children) != this._contentChildren.length) {
    //         return true;
    //     }
    //     let arr = React.Children.toArray(children);
    //     for (let i = 0; i < arr.length; i++) {
    //         if ((arr[i] as any).props.name !== this._contentChildren[i].props.name) {
    //             return true;
    //         }
    //     }
    //     return false;
    // }
    IgrDataChart.prototype._getMainRef = function (ref) {
        this._elRef = ref;
    };
    IgrDataChart.prototype.render = function () {
        // if (!this._childrenDiffer(this.props.children)) {
        // 	let div = React.createElement("div", {
        // 		ref: (ref) => {
        // 			this._elRef = ref;
        // 		},
        // 		children: this.props.children
        // 	});
        // 	return div;
        // } else {
        var children = this._contentChildrenManager.getChildren(this.props.children);
        //this._contentChildrenUnresolved = this._contentChildrenMap.size;
        if (this._currentTooltips && this._currentTooltips.length > 0) {
            //children = React.Children.toArray(this.props.children);
            for (var i = 0; i < this._currentTooltips.length; i++) {
                var t = this._currentTooltips[i];
                if (this._activeTooltipElements.has(t)) {
                    children.push(this._activeTooltipElements.get(t));
                }
                else {
                    if (!TypeRegistrar.isRegistered("IgrTooltipContainer")) {
                        continue;
                    }
                    var Tooltip = TypeRegistrar.get("IgrTooltipContainer");
                    var tEle = React.createElement(Tooltip, {
                        ref: this._tooltipRef,
                        key: this._currentTooltips[i].key,
                        owner: this._currentTooltips[i]
                    });
                    var portal = ReactDOM.createPortal(tEle, t, this._currentTooltips[i].key);
                    this._activeTooltipElements.set(t, portal);
                    children.push(portal);
                }
            }
        }
        var div = React.createElement("div", {
            className: "ig-data-chart igr-data-chart",
            ref: this._getMainRef,
            children: children
        });
        return div;
        //}
    };
    IgrDataChart.prototype._tooltipRef = function (t) {
        //console.log(t);
        if (t === null) {
            return;
        }
        if (t.currentOwner &&
            t.currentOwner.tooltipTemplate) {
            t.template = t.currentOwner.tooltipTemplate;
        }
        this._activeTooltips.set(t.currentOwner, t);
    };
    IgrDataChart.prototype.componentDidMount = function () {
        _super.prototype.componentDidMount.call(this);
        this._elRef.style.width = this._width ? this._width : "";
        this._elRef.style.height = this._height ? this._height : "";
        this._elRef.appendChild(this._container);
        this._chart.notifyContainerResized();
        this.initializeContent();
    };
    Object.defineProperty(IgrDataChart.prototype, "width", {
        get: function () {
            return this._width;
        },
        set: function (value) {
            this._width = value;
            if (this._elRef) {
                this._elRef.style.width = value;
                this._chart.notifyContainerResized();
            }
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "series", {
        /**
         * A collection or manually added series for the chart.
        */
        get: function () {
            var _this = this;
            if (this._series === null) {
                var coll = new IgrSeriesCollection();
                var inner = coll._innerColl;
                inner.addListener(function (sender, e) {
                    switch (e.action) {
                        case NotifyCollectionChangedAction.Add:
                            _this._seriesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));
                            break;
                        case NotifyCollectionChangedAction.Remove:
                            _this._seriesAdapter.removeManualItemAt(e.oldStartingIndex);
                            break;
                        case NotifyCollectionChangedAction.Replace:
                            _this._seriesAdapter.removeManualItemAt(e.oldStartingIndex);
                            _this._seriesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));
                            break;
                        case NotifyCollectionChangedAction.Reset:
                            _this._seriesAdapter.clearManualItems();
                            break;
                    }
                });
                this._series = coll;
            }
            return this._series;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "axes", {
        /**
         * A collection or manually added axes for the chart.
        */
        get: function () {
            var _this = this;
            if (this._axes === null) {
                var coll = new IgrAxisCollection();
                var inner = coll._innerColl;
                inner.addListener(function (sender, e) {
                    switch (e.action) {
                        case NotifyCollectionChangedAction.Add:
                            _this._axesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));
                            break;
                        case NotifyCollectionChangedAction.Remove:
                            _this._axesAdapter.removeManualItemAt(e.oldStartingIndex);
                            break;
                        case NotifyCollectionChangedAction.Replace:
                            _this._axesAdapter.removeManualItemAt(e.oldStartingIndex);
                            _this._axesAdapter.insertManualItem(e.newStartingIndex, e.newItems.item(0));
                            break;
                        case NotifyCollectionChangedAction.Reset:
                            _this._axesAdapter.clearManualItems();
                            break;
                    }
                });
                this._axes = coll;
            }
            return this._axes;
        },
        enumerable: false,
        configurable: true
    });
    IgrDataChart.prototype.destroy = function () {
        this._chart.destroy();
        this._wrapper.destroy();
    };
    IgrDataChart.prototype.componentWillUnmount = function () {
    };
    IgrDataChart.prototype.createImplementation = function () {
        return new XamDataChart();
    };
    Object.defineProperty(IgrDataChart.prototype, "dataSource", {
        get: function () {
            return this._dataSource;
        },
        set: function (value) {
            this._dataSource = value;
            this.bindData();
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "highlightedDataSource", {
        get: function () {
            return this._highlightedDataSource;
        },
        set: function (value) {
            this._highlightedDataSource = value;
            this.bindHighlightedData();
        },
        enumerable: false,
        configurable: true
    });
    IgrDataChart.prototype.bindData = function () {
        //console.log("binding data: " + this._dataSource);
        if (this.actualAxes && this.actualAxes.length > 0) {
            var currAxes = this.actualAxes;
            for (var i = 0; i < currAxes.length; i++) {
                currAxes[i].provideData(this._dataSource);
            }
        }
        if (this.actualSeries && this.actualSeries.length > 0) {
            var currSeries = this.actualSeries;
            for (var i = 0; i < currSeries.length; i++) {
                currSeries[i].provideData(this._dataSource);
            }
        }
    };
    IgrDataChart.prototype.bindHighlightedData = function () {
        if (this.actualSeries && this.actualSeries.length > 0) {
            var currSeries = this.actualSeries;
            for (var i = 0; i < currSeries.length; i++) {
                currSeries[i].provideHighlightedData(this._highlightedDataSource);
            }
        }
    };
    IgrDataChart.prototype.initializeContent = function () {
        if (TypeRegistrar.isRegistered("IgrDataChartDefaultTooltips")) {
            var d = TypeRegistrar.create("IgrDataChartDefaultTooltips");
            this._defaultTooltips = d;
            this._onDefaultTooltipsReady(d);
            //this._container.appendChild(cr.location.nativeElement);
        }
        this._styling(this._container, this);
        if (this.actualAxes && this.actualAxes.length > 0) {
            var currAxes = this.actualAxes;
            for (var i = 0; i < currAxes.length; i++) {
                currAxes[i]._styling(this._container, this, this);
            }
        }
        if (this.actualSeries && this.actualSeries.length > 0) {
            var currSeries = this.actualSeries;
            for (var i = 0; i < currSeries.length; i++) {
                currSeries[i]._styling(this._container, this, this);
            }
        }
        this.i.notifyContainerResized();
    };
    //private _checkCrossing() {
    //    let toBind: IgrAxis[] = [];
    //    let byName = new Map<string, IgrAxis>();
    //    for (let i = 0; i < this.actualAxes.length; i++) {
    //        byName.set(this.actualAxes[i].name, this.actualAxes[i]);
    //        if (this.actualAxes[i].crossingAxisName) {
    //            toBind.push(this.actualAxes[i]);
    //        }
    //    }
    //    for (let i = 0; i < toBind.length; i++) {
    //        if (byName.has(toBind[i].crossingAxisName)) {
    //            if (toBind[i].crossingAxis !== byName.get(toBind[i].crossingAxisName)) {
    //                toBind[i].crossingAxis = byName.get(toBind[i].crossingAxisName);
    //            }
    //        }
    //    }
    //}
    IgrDataChart.prototype._ensureTooltipCreated = function (series) {
        var _this = this;
        series._ensureTooltipCreated(function () { return _this.createTooltip(); }, function (ele) {
            var wrapper = new ReactWrapper(ele, _this._wrapper);
            wrapper.updateToolTip = ele.updateToolTip;
            wrapper.hideToolTip = ele.hideToolTip;
            if (_this._activeTooltips.has(ele)) {
                var tCont = _this._activeTooltips.get(ele);
                tCont.template = ele.tooltipTemplate;
            }
            return wrapper;
        });
    };
    IgrDataChart.prototype._ensureDefaultTooltip = function (series) {
        if (this._defaultTooltips == null) {
            return;
        }
        this._defaultTooltips["ensureDefaultTooltip"](series);
    };
    IgrDataChart.prototype._onDefaultTooltipsReady = function (cr) {
        if (this.actualSeries && this.actualSeries.length > 0) {
            var currSeries = this.actualSeries;
            for (var i = 0; i < currSeries.length; i++) {
                if (currSeries[i].showDefaultTooltip) {
                    this._ensureDefaultTooltip(currSeries[i]);
                }
            }
        }
    };
    IgrDataChart.prototype.createTooltip = function () {
        // if (!TypeRegistrar.isRegistered("IgrTooltipContainer")) {
        // 	return null;
        // }
        // let Tooltip = TypeRegistrar.get("IgrTooltipContainer");
        var wrapper = this._wrapper.createElement("div");
        var ele = wrapper.getNativeElement();
        ele.key = "__tooltip_" + this._uniqueTooltipId;
        this._uniqueTooltipId++;
        this._currentTooltips = this._currentTooltips.slice(0);
        this._currentTooltips.push(ele);
        //let element = React.createElement(Tooltip,  );
        //let portal = ReactDOM.createPortal(element, ele);
        var self = this;
        ele.updateToolTip = function (c, isSubContent) {
            if (c.externalObject) {
                c = c.externalObject;
            }
            else {
                var ext = new IgrDataContext();
                ext._implementation = c;
                c = ext;
            }
            if (!isSubContent) {
                if (ele.parentElement != self._container) {
                    if (ele.parentElement != null) {
                        ele.parentElement.removeChild(ele);
                    }
                    self._container.appendChild(ele);
                }
            }
            else {
                c.isSubContent = true;
            }
            if (self._activeTooltips.has(ele)) {
                var t = self._activeTooltips.get(ele);
                t.dataContext = c;
            }
            ele.style.display = "block";
            return true;
        };
        ele.hideToolTip = function () {
            ele.style.display = "none";
        };
        ele.style.display = "none";
        this._updateTooltipState();
        return ele;
    };
    IgrDataChart.prototype._updateTooltipState = function () {
        if (this._initialized) {
            this.setState({ tooltips: this._currentTooltips });
        }
    };
    Object.defineProperty(IgrDataChart.prototype, "syncChannel", {
        /**
         * Gets or sets the channel with which to synchronize.
        *
        * Synchronization is the coordination of zooming, panning and crosshairs events between multiple charts. Multiple chart controls can be synchronized horizontally (along X-Axis), vertically (along Y-Axis), or both. If you want to synchronize a set of charts, assign them the same name to the `syncChannel` and then specify whether or not synchronize chart horizontally and/or vertically.
        */
        get: function () {
            return this.i.syncChannel;
        },
        set: function (v) {
            var newLink = null;
            if (v && v.length > 0) {
                newLink = SyncLinkManager.instance().getLink(v);
            }
            var oldLink = this.i.actualSyncLink;
            if (oldLink) {
                SyncLinkManager.instance().releaseLink(oldLink);
            }
            if (newLink) {
                this.i.actualSyncLink = newLink;
            }
            else {
                this.i.actualSyncLink = new SyncLink();
            }
            this.i.syncChannel = v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "synchronizeVertically", {
        /**
         * Gets or sets the bool used to display the window preview shadow.
        *
        * Synchronization is the coordination of zooming, panning and crosshairs events between multiple charts. Multiple chart controls can be synchronized horizontally (along X-Axis), vertically (along Y-Axis), or both. If you want to synchronize a set of charts, assign them the same name to the `syncChannel` and then specify whether or not synchronize chart horizontally and/or vertically.
        */
        get: function () {
            return this.i.syncSettings ? this.i.syncSettings.synchronizeVertically : false;
        },
        set: function (v) {
            this.i.syncSettings.synchronizeVertically = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "synchronizeHorizontally", {
        /**
         * Gets or sets the bool used to display the window preview shadow.
        *
        * Synchronization is the coordination of zooming, panning and crosshairs events between multiple charts. Multiple chart controls can be synchronized horizontally (along X-Axis), vertically (along Y-Axis), or both. If you want to synchronize a set of charts, assign them the same name to the `syncChannel` and then specify whether or not synchronize chart horizontally and/or vertically.
        */
        get: function () {
            return this.i.syncSettings ? this.i.syncSettings.synchronizeHorizontally : false;
        },
        set: function (v) {
            this.i.syncSettings.synchronizeHorizontally = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "i", {
        /**
                                 * @hidden
                                 */
        get: function () {
            return this._implementation;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "isSquare", {
        /**
     * Gets or sets whether to use a square aspect ratio for the chart. This is locked to true for polar and radial charts.
    *
    * Set `IsSquare` to true to constrain the chart to a square, using the minimum of its height and width.
    *
    * ```ts
    *  this.chart.isSquare="True";
    * ```
    *
    * ```ts
    *  <IgrDataChart
    * 	IsHorizontalZoomEnabled="True"
    *     dataSource={this.state.dataSource} >
    *
    *     <IgrCategoryXAxis name="xAxis" />
    *     <IgrNumericYAxis name="yAxis" />
    *
    *     <IgrColumnSeries
    *      name="series1"
    *     xAxisName="xAxis"
    * 	yAxisName="yAxis"
    * 	valueMemberPath="Value" />
    *  </IgrDataChart>
    * ```
    */
        get: function () {
            return this.i.u4;
        },
        set: function (v) {
            this.i.u4 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "windowScaleHorizontal", {
        /**
         * A number between 0 and 1 determining the scale of the horizontal zoom.
         * This property is effectively a shortcut to the Width of the WindowRect property.
        *
        * To programmatically change the horizontal zoom level, set `WindowScaleHorizontal` to a value between 0 and 1.
        *
        * ```ts
        * this.chart.windowScaleHorizontal="0.75";
        * ```
        *
        * ```ts
        *  <IgrDataChart
        * 	windowScaleHorizontal="0.75"
        *     dataSource={this.state.dataSource} >
        *
        *     <IgrCategoryXAxis name="xAxis" />
        *     <IgrNumericYAxis name="yAxis" />
        *
        *     <IgrColumnSeries
        *      name="series1"
        *     xAxisName="xAxis"
        * 	yAxisName="yAxis"
        * 	valueMemberPath="Value" />
        *  </IgrDataChart>
        * ```
        */
        get: function () {
            return this.i.wb;
        },
        set: function (v) {
            this.i.wb = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "windowScaleVertical", {
        /**
         * A number between 0 and 1 determining the scale of the vertical zoom.
         * This property is effectively a shortcut to the Height of the WindowRect property.
        *
        * To programmatically change the vertical zoom level, set `WindowScaleVertical` to a value between 0 and 1.
        *
        * ```ts
        * this.chart.windowScaleVertical="0.75";
        * ```
        *
        * ```ts
        *  <IgrDataChart
        * 	windowScaleVertical="0.75"
        *     dataSource={this.state.dataSource} >
        *
        *     <IgrCategoryXAxis name="xAxis" />
        *     <IgrNumericYAxis name="yAxis" />
        *
        *     <IgrColumnSeries
        *      name="series1"
        *     xAxisName="xAxis"
        * 	yAxisName="yAxis"
        * 	valueMemberPath="Value" />
        *  </IgrDataChart>
        * ```
        */
        get: function () {
            return this.i.wc;
        },
        set: function (v) {
            this.i.wc = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "actualWindowScaleHorizontal", {
        /**
         * A number between 0 and 1 determining the scale of the horizontal zoom.
         * This property is effectively a shortcut to the Width of the ActualWindowRect property.
        */
        get: function () {
            return this.i.vw;
        },
        set: function (v) {
            this.i.vw = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "actualWindowScaleVertical", {
        /**
         * A number between 0 and 1 determining the scale of the vertical zoom.
         * This property is effectively a shortcut to the Height of the ActualWindowRect property.
        */
        get: function () {
            return this.i.vx;
        },
        set: function (v) {
            this.i.vx = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "isHorizontalZoomEnabled", {
        /**
         * Gets or sets horizontal zoomability of the current control
        *
        * Set `IsHorizontalZoomEnabled` to enable or disable horizontal zooming.
        *
        * ```ts
        * this.chart.IsHorizontalZoomEnabled= true;
        * ```
        *
        * ```ts
        *  <IgrDataChart
        * 	IsHorizontalZoomEnabled="True"
        *     dataSource={this.state.dataSource} >
        *
        *     <IgrCategoryXAxis name="xAxis" />
        *     <IgrNumericYAxis name="yAxis" />
        *
        *     <IgrColumnSeries
        *      name="series1"
        *     xAxisName="xAxis"
        * 	yAxisName="yAxis"
        * 	valueMemberPath="Value" />
        *  </IgrDataChart>
        * ```
        */
        get: function () {
            return this.i.u2;
        },
        set: function (v) {
            this.i.u2 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "isVerticalZoomEnabled", {
        /**
         * Gets or sets vertical zoomability of the current control
        *
        * Set `IsVerticalZoomEnabled` to enable or disable vertical zooming.
        *
        * ```ts
        * this.chart.isVerticalZoomEnabled="True";
        * ```
        *
        * ```ts
        *  <IgrDataChart
        * 	IsVerticalZoomEnabled="True"
        *     dataSource={this.state.dataSource} >
        *
        *     <IgrCategoryXAxis name="xAxis" />
        *     <IgrNumericYAxis name="yAxis" />
        *
        *     <IgrColumnSeries
        *      name="series1"
        *     xAxisName="xAxis"
        * 	yAxisName="yAxis"
        * 	valueMemberPath="Value" />
        *  </IgrDataChart>
        * ```
        */
        get: function () {
            return this.i.u5;
        },
        set: function (v) {
            this.i.u5 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "gridMode", {
        /**
         * Gets or sets how grid lines are rendered in relation to series.
        *
        *  Try setting the `GridMode` property to bring your grid lines in front of the data series.
        */
        get: function () {
            return this.i.ui;
        },
        set: function (v) {
            this.i.ui = ensureEnum(GridMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "alignsGridLinesToPixels", {
        /**
         * Gets or sets a value indicating whether grid and tick lines are aligned to device pixels.
        */
        get: function () {
            return this.i.uy;
        },
        set: function (v) {
            this.i.uy = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "autoExpandMarginMaximumValue", {
        /**
         * Gets or sets the maximum amount the series viewer should auto expand margins to accomodate the initial horizontal axis labels.
        */
        get: function () {
            return this.i.vz;
        },
        set: function (v) {
            this.i.vz = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "autoExpandMarginExtraPadding", {
        /**
         * Gets or sets the extra amount the series viewer should auto expand margins to accomodate the initial horizontal axis labels.
        */
        get: function () {
            return this.i.vy;
        },
        set: function (v) {
            this.i.vy = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "shouldSuppressAxisLabelTruncation", {
        /**
         * Gets or sets a whether the series viewer should suppress truncation of axis labels.
        */
        get: function () {
            return this.i.vc;
        },
        set: function (v) {
            this.i.vc = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "shouldAutoExpandMarginForInitialLabels", {
        /**
         * Gets or sets a whether the series viewer should auto expand margins to accomodate the initial horizontal axis labels.
        */
        get: function () {
            return this.i.u8;
        },
        set: function (v) {
            this.i.u8 = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "shouldConsiderAutoRotationForInitialLabels", {
        /**
         * Gets or sets a whether the series viewer should consider auto rotating labels to fit them in the initial view. This implies that ShouldAutoExpandMarginForInitialLabels is true.
        */
        get: function () {
            return this.i.vb;
        },
        set: function (v) {
            this.i.vb = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "suppressAutoMarginAndAngleRecalculation", {
        /**
         * Gets or sets a whether the series viewer should suppress auto recalculating margin and axis label angles.
        */
        get: function () {
            return this.i.vd;
        },
        set: function (v) {
            this.i.vd = ensureBool(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "autoMarginAndAngleUpdateMode", {
        /**
         * Gets or sets a whether the series viewer should consider auto rotating labels to fit them in the initial view. This implies that ShouldAutoExpandMarginForInitialLabels is true.
        */
        get: function () {
            return this.i.ud;
        },
        set: function (v) {
            this.i.ud = ensureEnum(AutoMarginsAndAngleUpdateMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "defaultAxisStroke", {
        /**
         * Gets or sets the DefaultAxisStroke property.
         * The DefaultAxisStroke property defines the brush which is used by the axes when no
         * Axis.Stroke is set.
        */
        get: function () {
            return brushToString(this.i.ye);
        },
        set: function (v) {
            this.i.ye = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "defaultAxisMajorStroke", {
        /**
         * Gets or sets the DefaultAxisMajorStroke property.
         * The DefaultAxisMajorStroke property defines the brush which is used by the axes when no
         * Axis.MajorStroke is set.
        */
        get: function () {
            return brushToString(this.i.yc);
        },
        set: function (v) {
            this.i.yc = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "defaultAxisMinorStroke", {
        /**
         * Gets or sets the DefaultAxisMinorStroke property.
         * The DefaultAxisMinorStroke property defines the brush which is used by the axes when no
         * Axis.MinorStroke is set.
        */
        get: function () {
            return brushToString(this.i.yd);
        },
        set: function (v) {
            this.i.yd = stringToBrush(v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "actualPlotAreaMarginLeft", {
        /**
         * Gets the actual resolved left plot area margin;
        */
        get: function () {
            return this.i.vt;
        },
        set: function (v) {
            this.i.vt = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "actualPlotAreaMarginTop", {
        /**
         * Gets the actual resolved top plot area margin;
        */
        get: function () {
            return this.i.vv;
        },
        set: function (v) {
            this.i.vv = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "actualPlotAreaMarginRight", {
        /**
         * Gets the actual resolved right plot area margin;
        */
        get: function () {
            return this.i.vu;
        },
        set: function (v) {
            this.i.vu = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "actualPlotAreaMarginBottom", {
        /**
         * Gets the actual resolved bottom plot area margin;
        */
        get: function () {
            return this.i.vs;
        },
        set: function (v) {
            this.i.vs = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "computedPlotAreaMarginMode", {
        /**
         * Gets or sets mode to use for automatically calculating the plot area margin.
        */
        get: function () {
            return this.i.ug;
        },
        set: function (v) {
            this.i.ug = ensureEnum(ComputedPlotAreaMarginMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "seriesPlotAreaMarginHorizontalMode", {
        /**
         * Gets or sets horizontal mode to use for automatically calculating the plot area margin based ont the series.
        */
        get: function () {
            return this.i.un;
        },
        set: function (v) {
            this.i.un = ensureEnum(SeriesPlotAreaMarginHorizontalMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "seriesPlotAreaMarginVerticalMode", {
        /**
         * Gets or sets vertical mode to use for automatically calculating the plot area margin based ont the series.
        */
        get: function () {
            return this.i.uq;
        },
        set: function (v) {
            this.i.uq = ensureEnum(SeriesPlotAreaMarginVerticalMode_$type, v);
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "plotAreaMarginLeft", {
        /**
         * Margin applied to the left of the plot area.
        */
        get: function () {
            return this.i.v7;
        },
        set: function (v) {
            this.i.v7 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "plotAreaMarginTop", {
        /**
         * Margin applied above the plot area.
        */
        get: function () {
            return this.i.v9;
        },
        set: function (v) {
            this.i.v9 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "plotAreaMarginRight", {
        /**
         * Margin applied to the right of the plot area.
        */
        get: function () {
            return this.i.v8;
        },
        set: function (v) {
            this.i.v8 = +v;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(IgrDataChart.prototype, "plotAreaMarginBottom", {
        /**
         * Margin applied below the plot area.
        */
        get: function () {
            return this.i.v6;
        },
        set: function (v) {
            this.i.v6 = +v;
        },
        enumerable: false,
        configurable: true
    });
    IgrDataChart.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.axes != null && this.axes.findByName && this.axes.findByName(name)) {
            return this.axes.findByName(name);
        }
        return null;
    };
    IgrDataChart.prototype.refreshComputedPlotAreaMargin = function () {
        this.i.xk();
    };
    IgrDataChart.prototype.recalculateMarginAutoExpansion = function () {
        this.i.xj();
    };
    IgrDataChart.prototype.recalculateAutoLabelsAngle = function () {
        this.i.xi();
    };
    /**
     * Notifies the chart that the CSS styles in effect have been updated.
    
    */
    IgrDataChart.prototype.styleUpdated = function () {
        this.i.xl();
    };
    /**
     * Export serialized visual data.
    
    */
    IgrDataChart.prototype.exportSerializedVisualData = function () {
        var iv = this.i.wt();
        return (iv);
    };
    return IgrDataChart;
}(IgrSeriesViewer));
export { IgrDataChart };
