import * as tslib_1 from "tslib";
import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core';
import { TrendLineType, TrendLineType_$type } from "igniteui-angular-core";
import { PriceDisplayType, PriceDisplayType_$type } from "./PriceDisplayType";
import { IgxFinancialSeriesComponent } from "./igx-financial-series-component";
import { IgxSeriesComponent } from "./igx-series-component";
import { FinancialPriceSeries } from "./FinancialPriceSeries";
import { ensureEnum, brushToString, stringToBrush, toPoint, fromRect } from "igniteui-angular-core";
/**
 * Represents a IgxDataChartComponent financial price series that renders as Candlestick or OHLC representations.
 * Default required members: Open, Low, High, Close
*
* The `IgxFinancialPriceSeriesComponent` class represents a IgxDataChartComponent financial price series that renders as Candlestick or OHLC representations.
*
* ```html
*  <igx-data-chart
*     #chart
*         [dataSource]="data" >
*  <igx-ordinal-time-x-axis
*     dateTimeMemberPath="TimeStamp"
*     #xAxis >
*     </igx-ordinal-time-x-axis>
*  <igx-numeric-y-axis
*         minimumValue="0"
*         #yAxis>
* </igx-numeric-y-axis>
* <igx-financial-price-series
*     [xAxis]="xAxis"
*       [yAxis]="yAxis"
*       openMemberPath="open"
*       highMemberPath="high"
*       lowMemberPath="low"
*       closeMemberPath="close"
*       volumeMemberPath="volume"
*       >
* </igx-financial-price-series>
* </igx-data-chart>
* ```
*
* ```ts
* let series = new IgxFinancialPriceSeriesComponent();
*    series.xAxis = this.xAxis;
*    series.yAxis = this.yAxis;
*    series.openMemberPath = "open";
*    series.highMemberPath = "high";
*    series.lowMemberPath = "low";
*    series.closeMemberPath = "close";
*    series.volumeMemberPath="volume";
*    this.chart.series.add(series);
* ```
*/
export var IgxFinancialPriceSeriesComponent_PROVIDERS = [{ provide: IgxFinancialSeriesComponent, useExisting: forwardRef(function () { return IgxFinancialPriceSeriesComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxFinancialPriceSeriesComponent; }) }];
var IgxFinancialPriceSeriesComponent = /** @class */ (function (_super) {
    tslib_1.__extends(IgxFinancialPriceSeriesComponent, _super);
    function IgxFinancialPriceSeriesComponent() {
        return _super.call(this) || this;
    }
    IgxFinancialPriceSeriesComponent_1 = IgxFinancialPriceSeriesComponent;
    IgxFinancialPriceSeriesComponent.prototype.createImplementation = function () {
        return new FinancialPriceSeries();
    };
    Object.defineProperty(IgxFinancialPriceSeriesComponent.prototype, "i", {
        /**
                                     * @hidden
                                     */
        get: function () {
            return this._implementation;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFinancialPriceSeriesComponent.prototype, "trendLineType", {
        /**
         * Gets or sets the trend type for the current financial series.
        *
        * Use the `trendLineType` property for the trend type of the current financial series.
        *
        * ```ts
        * series.trendLineType= "CubicFit";
        * ```
        *
        * ```html
        *  <igx-data-chart
        *     #chart
        *         [dataSource]="data" >
        *  <igx-ordinal-time-x-axis
        *     dateTimeMemberPath="TimeStamp"
        *     #xAxis >
        *     </igx-ordinal-time-x-axis>
        *  <igx-numeric-y-axis
        *         minimumValue="0"
        *         #yAxis>
        * </igx-numeric-y-axis>
        * <igx-financial-price-series
        *     [xAxis]="xAxis"
        *       [yAxis]="yAxis"
        *       openMemberPath="open"
        *       highMemberPath="high"
        *       lowMemberPath="low"
        *       closeMemberPath="close"
        *       volumeMemberPath="volume"
        *       trendLineType="CubicFit">
        * </igx-financial-price-series>
        * </igx-data-chart>
        * ```
        */
        get: function () {
            return this.i.trendLineType;
        },
        set: function (v) {
            this.i.trendLineType = ensureEnum(TrendLineType_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFinancialPriceSeriesComponent.prototype, "trendLineBrush", {
        /**
         * Gets or sets the brush to use to draw the trend line.
        *
        * Use the `trendLineBrush` property to brush the the trend line.
        *
        * ```ts
        * series.trendLineBrush="red";
        * ```
        *
        * ```html
        *  <igx-data-chart
        *     #chart
        *         [dataSource]="data" >
        *  <igx-ordinal-time-x-axis
        *     dateTimeMemberPath="TimeStamp"
        *     #xAxis >
        *     </igx-ordinal-time-x-axis>
        *  <igx-numeric-y-axis
        *         minimumValue="0"
        *         #yAxis>
        * </igx-numeric-y-axis>
        * <igx-financial-price-series
        *     [xAxis]="xAxis"
        *       [yAxis]="yAxis"
        *       openMemberPath="open"
        *       highMemberPath="high"
        *       lowMemberPath="low"
        *       closeMemberPath="close"
        *       volumeMemberPath="volume"
        *      trendLineBrush="red" >
        * </igx-financial-price-series>
        * </igx-data-chart>
        * ```
        */
        get: function () {
            return brushToString(this.i.trendLineBrush);
        },
        set: function (v) {
            this.i.trendLineBrush = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFinancialPriceSeriesComponent.prototype, "actualTrendLineBrush", {
        /**
         * Gets the effective TrendLineBrush for this FinancialPriceSeries.
        *
        * Use the `actualTrendLineBrush` property to Gets the effective TrendLineBrush for the FinancialIndicator.
        */
        get: function () {
            return brushToString(this.i.p3);
        },
        set: function (v) {
            this.i.p3 = stringToBrush(v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFinancialPriceSeriesComponent.prototype, "trendLineThickness", {
        /**
         * Gets or sets the thickness of the current FinancialPriceSeries object's trend line.
        *
        * Use the `trendLineThickness` property for the thickness of the current FinancialPriceSeries object's trend line.
        *
        * ```ts
        * series.trendLineThickness=5;
        * ```
        *
        * ```html
        *  <igx-data-chart
        *     #chart
        *         [dataSource]="data" >
        *  <igx-ordinal-time-x-axis
        *     dateTimeMemberPath="TimeStamp"
        *     #xAxis >
        *     </igx-ordinal-time-x-axis>
        *  <igx-numeric-y-axis
        *         minimumValue="0"
        *         #yAxis>
        * </igx-numeric-y-axis>
        * <igx-financial-price-series
        *     [xAxis]="xAxis"
        *       [yAxis]="yAxis"
        *       openMemberPath="open"
        *       highMemberPath="high"
        *       lowMemberPath="low"
        *       closeMemberPath="close"
        *       volumeMemberPath="volume"
        *       trendLineThickness="3">
        * </igx-financial-price-series>
        * </igx-data-chart>
        * ```
        */
        get: function () {
            return this.i.trendLineThickness;
        },
        set: function (v) {
            this.i.trendLineThickness = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFinancialPriceSeriesComponent.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 the `trendLinePeriod` property for the periodo the the current series.
        *
        * ```ts
        * series.trendLinePeriod= 7;
        * ```
        *
        * ```html
        *  <igx-data-chart
        *     #chart
        *         [dataSource]="data" >
        *  <igx-ordinal-time-x-axis
        *     dateTimeMemberPath="TimeStamp"
        *     #xAxis >
        *     </igx-ordinal-time-x-axis>
        *  <igx-numeric-y-axis
        *         minimumValue="0"
        *         #yAxis>
        * </igx-numeric-y-axis>
        * <igx-financial-price-series
        *     [xAxis]="xAxis"
        *       [yAxis]="yAxis"
        *       openMemberPath="open"
        *       highMemberPath="high"
        *       lowMemberPath="low"
        *       closeMemberPath="close"
        *       volumeMemberPath="volume"
        *       trendLinePeriod="7">
        * </igx-financial-price-series>
        * </igx-data-chart>
        * ```
        */
        get: function () {
            return this.i.trendLinePeriod;
        },
        set: function (v) {
            this.i.trendLinePeriod = +v;
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFinancialPriceSeriesComponent.prototype, "displayType", {
        /**
         * Gets or sets the display type for the current FinancialPriceSeries object.
        *
        * Use the `displayType` property for the display type of the current FinancialPriceSeries object.
        *
        * ```html
        *  <igx-data-chart
        *     #chart
        *         [dataSource]="data" >
        *  <igx-ordinal-time-x-axis
        *     dateTimeMemberPath="TimeStamp"
        *     #xAxis >
        *     </igx-ordinal-time-x-axis>
        *  <igx-numeric-y-axis
        *         minimumValue="0"
        *         #yAxis>
        * </igx-numeric-y-axis>
        * <igx-financial-price-series
        *     [xAxis]="xAxis"
        *       [yAxis]="yAxis"
        *       openMemberPath="open"
        *       highMemberPath="high"
        *       lowMemberPath="low"
        *       closeMemberPath="close"
        *       volumeMemberPath="volume"
        *       displayType="Candlestick">
        * </igx-financial-price-series>
        * </igx-data-chart>
        * ```
        *
        * ```ts
        * series.displayType=PriceDisplayType.Candlestick;
        * ```
        */
        get: function () {
            return this.i.pk;
        },
        set: function (v) {
            this.i.pk = ensureEnum(PriceDisplayType_$type, v);
        },
        enumerable: true,
        configurable: true
    });
    Object.defineProperty(IgxFinancialPriceSeriesComponent.prototype, "negativeOutline", {
        /**
         * Brush to use for outlining negative elements in the series.
        *
        * Use the `negativeOutline` property to brush the outline negative elements in the series.
        *
        * ```ts
        * series.negativeOutline="red";
        * ```
        *
        * ```html
        *  <igx-data-chart
        *     #chart
        *         [dataSource]="data" >
        *  <igx-ordinal-time-x-axis
        *     dateTimeMemberPath="TimeStamp"
        *     #xAxis >
        *     </igx-ordinal-time-x-axis>
        *  <igx-numeric-y-axis
        *         minimumValue="0"
        *         #yAxis>
        * </igx-numeric-y-axis>
        * <igx-financial-price-series
        *     [xAxis]="xAxis"
        *       [yAxis]="yAxis"
        *       openMemberPath="open"
        *       highMemberPath="high"
        *       lowMemberPath="low"
        *       closeMemberPath="close"
        *       volumeMemberPath="volume"
        *       negativeOutline="Red" >
        * </igx-financial-price-series>
        * </igx-data-chart>
        * ```
        */
        get: function () {
            return brushToString(this.i.p4);
        },
        set: function (v) {
            this.i.p4 = stringToBrush(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 return the best available value bounding box within the series that has the best value match for the world position provided.
    */
    IgxFinancialPriceSeriesComponent.prototype.getSeriesValueBoundingBox = function (world) {
        var iv = this.i.lu(toPoint(world));
        return fromRect(iv);
    };
    /**
     * Scrolls the series to display the item for the specified data item.
     * The categorySeries 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` methos scrolls the series to display the item for the specified data item.
    */
    IgxFinancialPriceSeriesComponent.prototype.scrollIntoView = function (item) {
        var iv = this.i.c9(item);
        return (iv);
    };
    /**
     * For a category plotted series, returns the current width of the items within the categories. This only returns a value if the items have some form of width (e.g. columns, bars, etc.) otherwise 0 is returned.
    
    *
    * The `getItemSpan` method is used For a category plotted series, returns the current width of the items within the categories.
    *
    * This only returns a value if the items have some form of width (e.g. columns, bars, etc.) otherwise 0 is returned
    */
    IgxFinancialPriceSeriesComponent.prototype.getItemSpan = function () {
        var iv = this.i.eg();
        return (iv);
    };
    IgxFinancialPriceSeriesComponent.prototype.setNegativeColors = function (negativeBrush, negativeOutline) {
        this.i.ji(stringToBrush(negativeBrush), stringToBrush(negativeOutline));
    };
    var IgxFinancialPriceSeriesComponent_1;
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", Number),
        tslib_1.__metadata("design:paramtypes", [Number])
    ], IgxFinancialPriceSeriesComponent.prototype, "trendLineType", null);
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", String),
        tslib_1.__metadata("design:paramtypes", [String])
    ], IgxFinancialPriceSeriesComponent.prototype, "trendLineBrush", null);
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", String),
        tslib_1.__metadata("design:paramtypes", [String])
    ], IgxFinancialPriceSeriesComponent.prototype, "actualTrendLineBrush", null);
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", Number),
        tslib_1.__metadata("design:paramtypes", [Number])
    ], IgxFinancialPriceSeriesComponent.prototype, "trendLineThickness", null);
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", Number),
        tslib_1.__metadata("design:paramtypes", [Number])
    ], IgxFinancialPriceSeriesComponent.prototype, "trendLinePeriod", null);
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", Number),
        tslib_1.__metadata("design:paramtypes", [Number])
    ], IgxFinancialPriceSeriesComponent.prototype, "displayType", null);
    tslib_1.__decorate([
        Input(),
        tslib_1.__metadata("design:type", String),
        tslib_1.__metadata("design:paramtypes", [String])
    ], IgxFinancialPriceSeriesComponent.prototype, "negativeOutline", null);
    IgxFinancialPriceSeriesComponent = IgxFinancialPriceSeriesComponent_1 = tslib_1.__decorate([
        Component({
            selector: 'igx-financial-price-series',
            template: "",
            providers: [{ provide: IgxFinancialSeriesComponent, useExisting: forwardRef(function () { return IgxFinancialPriceSeriesComponent_1; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxFinancialPriceSeriesComponent_1; }) }],
            changeDetection: ChangeDetectionStrategy.OnPush
        }),
        tslib_1.__metadata("design:paramtypes", [])
    ], IgxFinancialPriceSeriesComponent);
    return IgxFinancialPriceSeriesComponent;
}(IgxFinancialSeriesComponent));
export { IgxFinancialPriceSeriesComponent };
//# sourceMappingURL=igx-financial-price-series-component.js.map