/*
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 { IgrNumericYAxis } from './igr-numeric-y-axis';
import { IgrStackedSeriesBase } from "./igr-stacked-series-base";
/**
 * Base class for stacked series with a category x-axis and a numeric y-axis.
*/
export class IgrHorizontalStackedSeriesBase extends IgrStackedSeriesBase {
    constructor(props) {
        super(props);
    }
    set xAxisName(value) {
        this._xAxisName = value;
    }
    get xAxisName() {
        return this._xAxisName;
    }
    set yAxisName(value) {
        this._yAxisName = value;
    }
    get yAxisName() {
        return this._yAxisName;
    }
    bindAxes(axes) {
        for (let i = 0; i < axes.length; i++) {
            if (axes[i].name == this.xAxisName) {
                this.xAxis = axes[i];
            }
            if (axes[i].name == this.yAxisName) {
                this.yAxis = axes[i];
            }
        }
    }
    get i() {
        return this._implementation;
    }
    /**
 * Gets or sets the effective x-axis for this series.
*/
    get xAxis() {
        if (this.i.xAxis == null) {
            return null;
        }
        return this.i.xAxis.externalObject;
    }
    set xAxis(v) {
        v == null ? this.i.xAxis = null : this.i.xAxis = v.i;
    }
    /**
     * Gets or sets the effective y-axis for this series.
    */
    get yAxis() {
        if (this.i.yAxis == null) {
            return null;
        }
        if (!this.i.yAxis.externalObject) {
            let e = new IgrNumericYAxis(null);
            e._implementation = this.i.yAxis;
            this.i.yAxis.externalObject = e;
        }
        return this.i.yAxis.externalObject;
    }
    set yAxis(v) {
        v == null ? this.i.yAxis = null : this.i.yAxis = v.i;
    }
    /**
 * Returns the offset value for this series if grouped on a category axis.

*/
    getOffsetValue() {
        let iv = this.i.getOffsetValue();
        return (iv);
    }
    /**
     * Returns the width of the category grouping this series is in.
    
    */
    getCategoryWidth() {
        let iv = this.i.getCategoryWidth();
        return (iv);
    }
    /**
     * Determine if object can be used as YAxis
    
    * @param axis  * The object to check
    */
    canUseAsYAxis(axis) {
        let iv = this.i.pq(axis);
        return (iv);
    }
    /**
     * Determine if object can be used as XAxis
    
    * @param axis  * The object to check
    */
    canUseAsXAxis(axis) {
        let iv = this.i.pp(axis);
        return (iv);
    }
}
