import * as tslib_1 from "tslib";
import { forwardRef, Input } from '@angular/core';
import { IndicatorDisplayType, IndicatorDisplayType_$type } from "./IndicatorDisplayType";
import { TrendLineType, TrendLineType_$type } from "igniteui-angular-core";
import { IgxFinancialSeriesComponent } from "./igx-financial-series-component";
import { IgxSeriesComponent } from "./igx-series-component";
import { ensureEnum, brushToString, stringToBrush, toPoint, fromRect } from "igniteui-angular-core";
/**
 * Represents the base functionality for a IgxDataChartComponent financial indicator series.
*
* The `IgxFinancialIndicatorComponent` class represents the base functionality for a IgxDataChartComponent financial indicator series.
*
* ```html
* <igx-data-chart  #chart
*     [dataSource]="data" >
* <igx-ordinal-time-x-axis
*     label="label"
*     #xAxis>
*     </igx-ordinal-time-x-axis>
*  <igx-numeric-y-axis
*     minimumValue="0"
*     #yAxis>
*     </igx-numeric-y-axis>
* <igx-mass-index-indicator
* [xAxis]="xAxis"
*     [yAxis]="yAxis"
*     openMemberPath="open"
*     highMemberPath="high"
*     lowMemberPath="low"
*     closeMemberPath="close"
*     volumeMemberPath="volume"   >
*     </igx-mass-index-indicator >
* </igx-data-chart>
* ```
*
* ```ts
* let series = new IgxMassIndexIndicatorComponent();
*    series.xAxis = this.xAxis;
*    series.yAxis = this.yAxis;
*    series.openMemberPath = "open";
*    series.highMemberPath = "high";
*    series.lowMemberPath = "low";
*    series.closeMemberPath = "close";
*    this.chart.series.add(series);
*
* ```
*/
export var IgxFinancialIndicatorComponent_PROVIDERS = [{ provide: IgxFinancialSeriesComponent, useExisting: forwardRef(function () { return IgxFinancialIndicatorComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxFinancialIndicatorComponent; }) }];
var IgxFinancialIndicatorComponent = /** @class */ (function (_super) {
    tslib_1.__extends(IgxFinancialIndicatorComponent, _super);
    function IgxFinancialIndicatorComponent() {
        return _super.call(this) || this;
    }
    Object.defineProperty(IgxFinancialIndicatorComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFinancialIndicatorComponent.prototype, "displayType", {
        /**
         * Gets or sets the display for the current FinancialIndicator object.
        *
        * The `displayType` property is used to display the current FinancialIndicator object.
        *
        * ```ts
        * series.displayType= IndicatorDisplayType.Column;
        * ```
        *
        * ```html
        * <igx-data-chart  #chart
        *     [dataSource]="data" >
        * <igx-ordinal-time-x-axis
        *     label="label"
        *     #xAxis>
        *     </igx-ordinal-time-x-axis>
        *  <igx-numeric-y-axis
        *     minimumValue="0"
        *     #yAxis>
        *     </igx-numeric-y-axis>
        * <igx-mass-index-indicator
        * [xAxis]="xAxis"
        *     [yAxis]="yAxis"
        *     openMemberPath="open"
        *     highMemberPath="high"
        *     lowMemberPath="low"
        *     closeMemberPath="close"
        *     volumeMemberPath="volume"
        * 	displayType="Column"   >
        *     </igx-mass-index-indicator >
        * </igx-data-chart>
        * ```
        */
        get: function () {
            return this.i.pk;
        },
        set: function (v) {
            this.i.pk = ensureEnum(IndicatorDisplayType_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFinancialIndicatorComponent.prototype, "ignoreFirst", {
        /**
         * Gets or sets the number of values to hide at the beginning of the indicator.
        *
        * Use the `ignoreFirst` propert to hide the number of values at the beginning of the indicator.
        *
        * ```html
        * <igx-data-chart  #chart
        *     [dataSource]="data" >
        * <igx-ordinal-time-x-axis
        *     label="label"
        *     #xAxis>
        *     </igx-ordinal-time-x-axis>
        *  <igx-numeric-y-axis
        *     minimumValue="0"
        *     #yAxis>
        *     </igx-numeric-y-axis>
        * <igx-mass-index-indicator
        * [xAxis]="xAxis"
        *     [yAxis]="yAxis"
        *     openMemberPath="open"
        *     highMemberPath="high"
        *     lowMemberPath="low"
        *     closeMemberPath="close"
        *     volumeMemberPath="volume"
        * 	ignoreFirst="2" >
        *     </igx-mass-index-indicator >
        * </igx-data-chart>
        * ```
        *
        * ```ts
        * series.ignoreFirst  = 2;
        * ```
        */
        get: function () {
            return this.i.pq;
        },
        set: function (v) {
            this.i.pq = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFinancialIndicatorComponent.prototype, "trendLineType", {
        /**
         * Gets or sets the trend type for the current indicator series.
        *
        * Use `trendLineType` property to get the trend type for the current indicator series.
        *
        * ```html
        * <igx-data-chart
        *     [dataSource]="data" >
        *    <igx-ordinal-time-x-axis
        *     label="label"
        *     #xAxis>
        *     </igx-ordinal-time-x-axis>
        *     <igx-numeric-y-axis #yAxis>
        *     </igx-numeric-y-axis>
        *     <igx-mass-index-indicator
        *         [xAxis]="xAxis"
        *         [yAxis]="yAxis"
        *         openMemberPath="open"
        *         highMemberPath="high"
        *         lowMemberPath="low"
        *         closeMemberPath="close"
        * 		trendLineType="CubicFit">
        *     </igx-mass-index-indicator>
        * </igx-data-chart>
        * ```
        *
        * ```ts
        * series.trendLineType= TrendLineType.CubicFit;
        * ```
        */
        get: function () {
            return this.i.trendLineType;
        },
        set: function (v) {
            this.i.trendLineType = ensureEnum(TrendLineType_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFinancialIndicatorComponent.prototype, "trendLineBrush", {
        /**
         * Gets or sets the brush to use to draw the trend line.
        *
        * Use the `trendLineBrush` propert to draw the trend line.
        *
        * ```html
        * <igx-data-chart  #chart
        *     [dataSource]="data" >
        * <igx-ordinal-time-x-axis
        *     label="label"
        *     #xAxis>
        *     </igx-ordinal-time-x-axis>
        *  <igx-numeric-y-axis
        *     minimumValue="0"
        *     #yAxis>
        *     </igx-numeric-y-axis>
        * <igx-mass-index-indicator
        * [xAxis]="xAxis"
        *     [yAxis]="yAxis"
        *     openMemberPath="open"
        *     highMemberPath="high"
        *     lowMemberPath="low"
        *     closeMemberPath="close"
        *     volumeMemberPath="volume"
        * 	trendLineBrush="Red">
        *     </igx-mass-index-indicator >
        * </igx-data-chart>
        * ```
        */
        get: function () {
            return brushToString(this.i.trendLineBrush);
        },
        set: function (v) {
            this.i.trendLineBrush = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFinancialIndicatorComponent.prototype, "actualTrendLineBrush", {
        /**
         * Gets the effective TrendLineBrush for this indicator.
        *
        * Use the `actualTrendLineBrush` property to Gets the effective TrendLineBrush for the FinancialIndicator.
        */
        get: function () {
            return brushToString(this.i.p8);
        },
        set: function (v) {
            this.i.p8 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFinancialIndicatorComponent.prototype, "trendLineThickness", {
        /**
         * Gets or sets the thickness of the current indicator object's trend line.
        *
        * Use `trendLineThickness` property for the thickness of the current indicator object's trend line.
        *
        * ```html
        * <igx-data-chart  #chart
        *     [dataSource]="data" >
        * <igx-ordinal-time-x-axis
        *     label="label"
        *     #xAxis>
        *     </igx-ordinal-time-x-axis>
        *  <igx-numeric-y-axis
        *     minimumValue="0"
        *     #yAxis>
        *     </igx-numeric-y-axis>
        * <igx-mass-index-indicator
        * [xAxis]="xAxis"
        *     [yAxis]="yAxis"
        *     openMemberPath="open"
        *     highMemberPath="high"
        *     lowMemberPath="low"
        *     closeMemberPath="close"
        *     volumeMemberPath="volume"
        * 	trendLineThickness="2" >
        *     </igx-mass-index-indicator >
        * </igx-data-chart>
        * ```
        *
        * ```ts
        *  series.trendLineThickness=2 ;
        * ```
        */
        get: function () {
            return this.i.trendLineThickness;
        },
        set: function (v) {
            this.i.trendLineThickness = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFinancialIndicatorComponent.prototype, "trendLinePeriod", {
        /**
         * Gets or sets the trend line period for the current series.
         * The typical, and initial, value for trend line period is 7.
        *
        * Use `trendLinePeriod` property for the trend line period of the current series.
        *
        * ```html
        * <igx-data-chart  #chart
        *     [dataSource]="data" >
        * <igx-ordinal-time-x-axis
        *     label="label"
        *     #xAxis>
        *     </igx-ordinal-time-x-axis>
        *  <igx-numeric-y-axis
        *     minimumValue="0"
        *     #yAxis>
        *     </igx-numeric-y-axis>
        * <igx-mass-index-indicator
        * [xAxis]="xAxis"
        *     [yAxis]="yAxis"
        *     openMemberPath="open"
        *     highMemberPath="high"
        *     lowMemberPath="low"
        *     closeMemberPath="close"
        *     volumeMemberPath="volume"
        * 	trendLinePeriod="30" >
        *     </igx-mass-index-indicator >
        * </igx-data-chart>
        * ```
        *
        * ```ts
        * series.trendLinePeriod  =30;
        * ```
        */
        get: function () {
            return this.i.trendLinePeriod;
        },
        set: function (v) {
            this.i.trendLinePeriod = +v;
        },
        enumerable: true,
        configurable: true
    });
    /**
     * If possible, will return the best available value bounding box within the series that has the best value match for the world position provided.
    
    * @param world  * The world coordinate for which to get a value bounding box for
    *
    * The `getSeriesValueBoundingBox` method returns the best available value bounding box within the series that has the best value match for the world position provided.
    */
    IgxFinancialIndicatorComponent.prototype.getSeriesValueBoundingBox = function (world) {
        var iv = this.i.lu(toPoint(world));
        return fromRect(iv);
    };
    IgxFinancialIndicatorComponent.prototype.getSeriesValue = function (world, useInterpolation, skipUnknowns) {
        var iv = this.i.en(toPoint(world), useInterpolation, skipUnknowns);
        return (iv);
    };
    IgxFinancialIndicatorComponent.prototype.getPreviousOrExactIndex = function (world, skipUnknowns) {
        var iv = this.i.fe(toPoint(world), skipUnknowns);
        return (iv);
    };
    IgxFinancialIndicatorComponent.prototype.getNextOrExactIndex = function (world, skipUnknowns) {
        var iv = this.i.fc(toPoint(world), skipUnknowns);
        return (iv);
    };
    /**
     * Scrolls the series to display the item for the specified data item.
     * The series is scrolled by the minimum amount required to place the specified data item within
     * the central 80% of the visible axis.
    
    * @param item  * The data item (item) to scroll to.
    *
    * The `scrollIntoView` method scrolls the series to display the item for the specified data item.
    */
    IgxFinancialIndicatorComponent.prototype.scrollIntoView = function (item) {
        var iv = this.i.c9(item);
        return (iv);
    };
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", Number),
        tslib_1.__metadata("design:paramtypes", [Number])
    ], IgxFinancialIndicatorComponent.prototype, "displayType", null);
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", Number),
        tslib_1.__metadata("design:paramtypes", [Number])
    ], IgxFinancialIndicatorComponent.prototype, "ignoreFirst", null);
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", Number),
        tslib_1.__metadata("design:paramtypes", [Number])
    ], IgxFinancialIndicatorComponent.prototype, "trendLineType", null);
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", String),
        tslib_1.__metadata("design:paramtypes", [String])
    ], IgxFinancialIndicatorComponent.prototype, "trendLineBrush", null);
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", String),
        tslib_1.__metadata("design:paramtypes", [String])
    ], IgxFinancialIndicatorComponent.prototype, "actualTrendLineBrush", null);
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", Number),
        tslib_1.__metadata("design:paramtypes", [Number])
    ], IgxFinancialIndicatorComponent.prototype, "trendLineThickness", null);
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", Number),
        tslib_1.__metadata("design:paramtypes", [Number])
    ], IgxFinancialIndicatorComponent.prototype, "trendLinePeriod", null);
    return IgxFinancialIndicatorComponent;
}(IgxFinancialSeriesComponent));
export { IgxFinancialIndicatorComponent };
//# sourceMappingURL=igx-financial-indicator-component.js.map