import * as tslib_1 from "tslib";
import { IgrCategoryAxisBase } from "./igr-category-axis-base";
import { IgrNumericYAxis } from "./igr-numeric-y-axis";
import { IgrRangeCategorySeries } from "./igr-range-category-series";
import { toPoint, fromPoint } from "igniteui-react-core";
/**
 * Base class for ranged category series with a category X-axis and a numeric Y-axis.
*
* Instantiate HorizontalAnchoredCategorySeries
*
* ```ts
*  <IgrDataChart
*     dataSource={this.state.dataSource} >
*
*     <IgrCategoryXAxis name="xAxis" />
*     <IgrNumericYAxis name="yAxis" />
*
*     <IgrColumnSeries
*      name="series1"
*     xAxisName="xAxis"
* 	yAxisName="yAxis"
* 	valueMemberPath="Value" />
*  </IgrDataChart>
* ```
*
* ```ts
* this.columnSeries1 = new IgrColumnSeries({ name: "colSeries1" });
* this.columnSeries1.dataSource = this.categoryData;
* this.columnSeries1.xAxis = this.categoryXAxis;
* this.columnSeries1.yAxis = this.numericYAxis;
* this.columnSeries1.xAxisName = "categoryXAxis";
* this.columnSeries1.yAxisName = "numericYAxis";
* this.columnSeries1.valueMemberPath = "USA";
* ```
*/
var IgrHorizontalRangeCategorySeries = /** @class */ /*@__PURE__*/ (function (_super) {
    tslib_1.__extends(IgrHorizontalRangeCategorySeries, _super);
    function IgrHorizontalRangeCategorySeries(props) {
        var _this = _super.call(this, props) || this;
        _this._xAxisName = null;
        _this._yAxisName = null;
        return _this;
    }
    Object.defineProperty(IgrHorizontalRangeCategorySeries.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrHorizontalRangeCategorySeries.prototype, "xAxis", {
        /**
         * Gets or sets the effective x-axis for the current CategorySeries object.
        *
        * Instantiate xAxis
        *
        * ```ts
        * this.columnSeries1 = new IgrColumnSeries({ name: "colSeries1" });
        * this.columnSeries1.dataSource = this.categoryData;
        * this.columnSeries1.xAxis = this.categoryXAxis;
        * this.columnSeries1.yAxis = this.numericYAxis;
        * this.columnSeries1.xAxisName = "categoryXAxis";
        * this.columnSeries1.yAxisName = "numericYAxis";
        * this.columnSeries1.valueMemberPath = "USA";
        * ```
        *
        * ```ts
        *  <IgrDataChart
        *     dataSource={this.state.dataSource} >
        *
        *     <IgrCategoryXAxis name="xAxis" />
        *     <IgrNumericYAxis name="yAxis" />
        *
        *     <IgrColumnSeries
        *      name="series1"
        *     xAxisName="xAxis"
        * 	yAxisName="yAxis"
        * 	valueMemberPath="Value" />
        *  </IgrDataChart>
        * ```
        */
        get: function () {
            if (this.i.xAxis == null) {
                return null;
            }
            if (!this.i.xAxis.externalObject) {
                var e = IgrCategoryAxisBase._createFromInternal(this.i.xAxis);
                if (e) {
                    e._implementation = this.i.xAxis;
                }
                this.i.xAxis.externalObject = e;
            }
            return this.i.xAxis.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.xAxis = null : this.i.xAxis = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrHorizontalRangeCategorySeries.prototype, "xAxisName", {
        /**
        * Gets or sets the name to use to resolve xAxis from markup.
        */
        get: function () {
            return this._xAxisName;
        },
        set: function (v) {
            this._xAxisName = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrHorizontalRangeCategorySeries.prototype, "yAxis", {
        /**
         * Gets or sets the effective y-axis for the current CategorySeries object.
        *
        * Instantiate yAxis
        *
        * ```ts
        *  <IgrDataChart
        *     dataSource={this.state.dataSource} >
        *
        *     <IgrCategoryXAxis name="xAxis" />
        *     <IgrNumericYAxis name="yAxis" />
        *
        *     <IgrColumnSeries
        *      name="series1"
        *     xAxisName="xAxis"
        * 	yAxisName="yAxis"
        * 	valueMemberPath="Value" />
        *  </IgrDataChart>
        * ```
        *
        * ```ts
        * this.columnSeries1 = new IgrColumnSeries({ name: "colSeries1" });
        * this.columnSeries1.dataSource = this.categoryData;
        * this.columnSeries1.xAxis = this.categoryXAxis;
        * this.columnSeries1.yAxis = this.numericYAxis;
        * this.columnSeries1.xAxisName = "categoryXAxis";
        * this.columnSeries1.yAxisName = "numericYAxis";
        * this.columnSeries1.valueMemberPath = "USA";
        * ```
        */
        get: function () {
            if (this.i.yAxis == null) {
                return null;
            }
            if (!this.i.yAxis.externalObject) {
                var e = IgrNumericYAxis._createFromInternal(this.i.yAxis);
                if (e) {
                    e._implementation = this.i.yAxis;
                }
                this.i.yAxis.externalObject = e;
            }
            return this.i.yAxis.externalObject;
        },
        set: function (v) {
            if (v != null && this._stylingContainer && v._styling)
                v._styling(this._stylingContainer, this, this);
            v == null ? this.i.yAxis = null : this.i.yAxis = v.i;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrHorizontalRangeCategorySeries.prototype, "yAxisName", {
        /**
        * Gets or sets the name to use to resolve yAxis from markup.
        */
        get: function () {
            return this._yAxisName;
        },
        set: function (v) {
            this._yAxisName = v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgrHorizontalRangeCategorySeries.prototype, "isRange", {
        /**
         * Checks if this series is a range series
        *
        * You can use the `isRange` to get the current series is a range type series.
        *
        * <!-- Angular JS -->
        *
        * ```ts
        *   var r = this.series.isRange;
        * ```
        */
        get: function () {
            return this.i.c3;
        },
        enumerable: true,
        configurable: true
    });
    IgrHorizontalRangeCategorySeries.prototype.bindAxes = function (axes) {
        _super.prototype.bindAxes.call(this, axes);
        for (var i = 0; i < axes.length; i++) {
            if (this.xAxisName && this.xAxisName.length > 0 &&
                axes[i].name == this.xAxisName) {
                this.xAxis = axes[i];
            }
        }
        for (var i = 0; i < axes.length; i++) {
            if (this.yAxisName && this.yAxisName.length > 0 &&
                axes[i].name == this.yAxisName) {
                this.yAxis = axes[i];
            }
        }
    };
    IgrHorizontalRangeCategorySeries.prototype.findByName = function (name) {
        var baseResult = _super.prototype.findByName.call(this, name);
        if (baseResult) {
            return baseResult;
        }
        if (this.xAxis && this.xAxis.name && this.xAxis.name == name) {
            return this.xAxis;
        }
        if (this.yAxis && this.yAxis.name && this.yAxis.name == name) {
            return this.yAxis;
        }
        return null;
    };
    IgrHorizontalRangeCategorySeries.prototype._styling = function (container, component, parent) {
        _super.prototype._styling.call(this, container, component, parent);
        this._inStyling = true;
        if (this.xAxis && this.xAxis._styling) {
            this.xAxis._styling(container, component, this);
        }
        if (this.yAxis && this.yAxis._styling) {
            this.yAxis._styling(container, component, this);
        }
        this._inStyling = false;
    };
    /**
     * Returns the offset value for this series if grouped on a category axis.
    
    *
    * You can use the `getOffsetValue` to get the offset value for this series if grouped on a category axis.
    *
    * <!-- Angular JS -->
    *
    *       var g = series.getOffsetValue();
    *
    * <!-- Ignite JS -->
    *
    *      N/A
    */
    IgrHorizontalRangeCategorySeries.prototype.getOffsetValue = function () {
        var iv = this.i.getOffsetValue();
        return (iv);
    };
    /**
     * Returns the width of the category grouping this series is in.
    
    *
    * You can use the `getCategoryWidth` to get the width of the category grouping a series is in.
    *
    * <!-- Angular JS -->
    *
    *      var x = this.financialSeries.CanUseAsXAxis(this.xAxis);
    *
    * <!-- Ignite JS -->
    *
    *      N/A
    */
    IgrHorizontalRangeCategorySeries.prototype.getCategoryWidth = function () {
        var iv = this.i.getCategoryWidth();
        return (iv);
    };
    IgrHorizontalRangeCategorySeries.prototype.getNextOrExactIndex = function (world, skipUnknowns) {
        var iv = this.i.fc(toPoint(world), skipUnknowns);
        return (iv);
    };
    IgrHorizontalRangeCategorySeries.prototype.getPreviousOrExactIndex = function (world, skipUnknowns) {
        var iv = this.i.fe(toPoint(world), skipUnknowns);
        return (iv);
    };
    IgrHorizontalRangeCategorySeries.prototype.getSeriesValue = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.en(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    };
    IgrHorizontalRangeCategorySeries.prototype.getSeriesLowValue = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.el(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    };
    IgrHorizontalRangeCategorySeries.prototype.getSeriesHighValue = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.ej(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    };
    IgrHorizontalRangeCategorySeries.prototype.getSeriesHighValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.lr(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    IgrHorizontalRangeCategorySeries.prototype.getSeriesLowValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.lt(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    IgrHorizontalRangeCategorySeries.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.lv(toPoint(world), useInterpolation, skipUnknowns);
        return fromPoint(iv);
    };
    /**
     * Determine if object can be used as YAxis
    
    * @param axis  * The object to check
    *
    * You can use the `canUseAsYAxis` method to determine if object can be used as YAxis
    */
    IgrHorizontalRangeCategorySeries.prototype.canUseAsYAxis = function (axis) {
        var iv = this.i.pr(axis);
        return (iv);
    };
    /**
     * Determine if object can be used as XAxis
    
    * @param axis  * The object to check
    *
    * You can use the `canUseAsXAxis` method to determine if object can be used as XAxis
    *
    * <!-- Angular JS -->
    *
    *      var x = this.financialSeries.CanUseAsXAxis(this.xAxis);
    */
    IgrHorizontalRangeCategorySeries.prototype.canUseAsXAxis = function (axis) {
        var iv = this.i.pq(axis);
        return (iv);
    };
    return IgrHorizontalRangeCategorySeries;
}(IgrRangeCategorySeries));
export { IgrHorizontalRangeCategorySeries };
//# sourceMappingURL=igr-horizontal-range-category-series.js.map
