import { TrendLineType_$type } from "igniteui-react-core";
import { PriceDisplayType_$type } from "./PriceDisplayType";
import { IgrFinancialSeries } from "./igr-financial-series";
import { FinancialPriceSeries } from "./FinancialPriceSeries";
import { ensureEnum, brushToString, stringToBrush, toDoubleCollection, fromDoubleCollection, toPoint, fromRect, fromPoint } from "igniteui-react-core";
/**
 * Represents a IgxDataChartComponent financial price series that renders as Candlestick or OHLC representations.
 * Default required members: Open, Low, High, Close
*
* The `FinancialPriceSeries` class represents a IgxDataChartComponent financial price series that renders as Candlestick or OHLC representations.
*
* ```ts
* <IgrDataChart
*     dataSource={this.state.dataSource}
*     width="700px"
*     height="500px">
*
*
*     <IgrCategoryXAxis name="xAxis" label="Date" />
*     <IgrNumericYAxis  name="yAxis" />
*
*
*     <IgrFinancialPriceSeries
*     name="series2"
*     xAxisName="xAxis"
*     yAxisName="yAxis"
*     displayType="Candlestick"
*     lowMemberPath="Low"
*     highMemberPath="High"
*     openMemberPath="Open"
*     closeMemberPath="Close"
*     volumeMemberPath="Volume" />
*  </IgrDataChart>
* ```
*
* ```ts
* this.series = new IgrFinancialPriceSeries({name: "series"});
* this.series.dataSource = this.financialData;
* this.series.xAxis = this.timeXAxis;
* this.series.yAxis = this.numericYAxis;
* this.series.xAxisName = "timeXAxis";
* this.series.yAxisName = "numericYAxis";
* this.series.highMemberPath="High" ;
* this.series.lowMemberPath="Low";
* this.series.closeMemberPath="Close";
* this.series.openMemberPath="Open";
* this.series.volumeMemberPath="Volume";
* ```
*/
export class IgrFinancialPriceSeries extends IgrFinancialSeries {
    createImplementation() {
        return new FinancialPriceSeries();
    }
    /**
                                 * @hidden
                                 */
    get i() {
        return this._implementation;
    }
    constructor(props) {
        super(props);
    }
    /**
     * Gets whether the series has financial OHLC/candlestick visuals
    */
    get isFinancialSeries() {
        return this.i.eo;
    }
    /**
     * 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
    * <IgrDataChart
    *     dataSource={this.state.dataSource}
    *     width="700px"
    *     height="500px">
    *
    *
    *     <IgrCategoryXAxis name="xAxis" label="Date" />
    *     <IgrNumericYAxis  name="yAxis" />
    *
    *
    *     <IgrFinancialPriceSeries
    *     name="series2"
    *     xAxisName="xAxis"
    *     yAxisName="yAxis"
    *     displayType="Candlestick"
    *     lowMemberPath="Low"
    *     highMemberPath="High"
    *     openMemberPath="Open"
    *     closeMemberPath="Close"
    *     volumeMemberPath="Volume"
    * 	trendLineType={this.state.trendLineType}  />
    *  </IgrDataChart>
    * ```
    *
    * ```ts
    * series.trendLineType= "CubicFit";
    * ```
    */
    get trendLineType() {
        return this.i.trendLineType;
    }
    set trendLineType(v) {
        this.i.trendLineType = ensureEnum(TrendLineType_$type, v);
    }
    /**
     * Gets or sets the brush to use to draw the trend line.
    *
    * Use the `TrendLineBrush` property to brush the the trend line.
    *
    * ```ts
    * <IgrDataChart
    *     dataSource={this.state.dataSource}
    *     width="700px"
    *     height="500px">
    *
    *
    *     <IgrCategoryXAxis name="xAxis" label="Date" />
    *     <IgrNumericYAxis  name="yAxis" />
    *
    *
    *     <IgrFinancialPriceSeries
    *     name="series2"
    *     xAxisName="xAxis"
    *     yAxisName="yAxis"
    *     displayType="Candlestick"
    *     lowMemberPath="Low"
    *     highMemberPath="High"
    *     openMemberPath="Open"
    *     closeMemberPath="Close"
    *     volumeMemberPath="Volume"
    * 	trendLineBrush="Blue" />
    *  </IgrDataChart>
    * ```
    *
    * ```ts
    * series.trendLineBrush="red";
    * ```
    */
    get trendLineBrush() {
        return brushToString(this.i.trendLineBrush);
    }
    set trendLineBrush(v) {
        this.i.trendLineBrush = stringToBrush(v);
    }
    /**
     * Gets the effective TrendLineBrush for this FinancialPriceSeries.
    *
    * Use the `ActualTrendLineBrush` property to Gets the effective TrendLineBrush for the FinancialIndicator.
    *
    * ````ts
    * <IgrDataChart
    *         ref={this.onChartRef}
    *         dataSource={this.data}
    *         width="100%"
    *         height="100%" >
    *
    *         <IgrCategoryXAxis name="xAxis" label="Label" />
    *         <IgrNumericYAxis name="yAxis" />
    *
    *         <IgrFinancialPriceSeries
    *             name="series1"
    *             xAxisName="xAxis"
    *             yAxisName="yAxis"
    *             highMemberPath="High"
    *             lowMemberPath="Low"
    *             closeMemberPath="Close"
    *             openMemberPath="Open"
    *             volumeMemberPath="Volume"
    *             trendLineType={this.state.trendLineType}
    *             displayType= "Candlestick"
    *             trendLinePeriod = {2}
    *             actualTrendLineBrush= "blue"/>
    *
    *     </IgrDataChart>
    *
    * 	```
    * ````
    */
    get actualTrendLineBrush() {
        return brushToString(this.i.zi);
    }
    set actualTrendLineBrush(v) {
        this.i.zi = stringToBrush(v);
    }
    /**
     * 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
    * <IgrDataChart
    *     dataSource={this.state.dataSource}
    *     width="700px"
    *     height="500px">
    *
    *
    *     <IgrCategoryXAxis name="xAxis" label="Date" />
    *     <IgrNumericYAxis  name="yAxis" />
    *
    *
    *     <IgrFinancialPriceSeries
    *     name="series2"
    *     xAxisName="xAxis"
    *     yAxisName="yAxis"
    *     displayType="Candlestick"
    *     lowMemberPath="Low"
    *     highMemberPath="High"
    *     openMemberPath="Open"
    *     closeMemberPath="Close"
    *     volumeMemberPath="Volume"
    * 	trendLineThickness="3"/>
    *  </IgrDataChart>
    * ```
    *
    * ```ts
    * series.trendLineThickness=5;
    * ```
    */
    get trendLineThickness() {
        return this.i.trendLineThickness;
    }
    set trendLineThickness(v) {
        this.i.trendLineThickness = +v;
    }
    /**
     * Gets or sets a collection of double values that indicate the pattern of dashes and gaps that
     * is used to draw the trend line for the current FinancialPriceSeries object.
    */
    get trendLineDashArray() {
        return fromDoubleCollection(this.i.zk);
    }
    set trendLineDashArray(v) {
        this.i.zk = toDoubleCollection(v);
    }
    /**
     * 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
    * <IgrDataChart
    *     dataSource={this.state.dataSource}
    *     width="700px"
    *     height="500px">
    *
    *
    *     <IgrCategoryXAxis name="xAxis" label="Date" />
    *     <IgrNumericYAxis  name="yAxis" />
    *
    *
    *     <IgrFinancialPriceSeries
    *     name="series2"
    *     xAxisName="xAxis"
    *     yAxisName="yAxis"
    *     displayType="Candlestick"
    *     lowMemberPath="Low"
    *     highMemberPath="High"
    *     openMemberPath="Open"
    *     closeMemberPath="Close"
    *     volumeMemberPath="Volume"
    * 	trendLinePeriod={7} />
    *  </IgrDataChart>
    * ```
    *
    * ```ts
    * series.trendLinePeriod= 7;
    * ```
    */
    get trendLinePeriod() {
        return this.i.trendLinePeriod;
    }
    set trendLinePeriod(v) {
        this.i.trendLinePeriod = +v;
    }
    /**
     * Gets or sets the display type for the current FinancialPriceSeries object.
    *
    * Use the `DisplayType` property for the display type of the current FinancialPriceSeries object.
    *
    * ```ts
    * <IgrDataChart
    *     dataSource={this.state.dataSource}
    *     width="700px"
    *     height="500px">
    *
    *
    *     <IgrCategoryXAxis name="xAxis" label="Date" />
    *     <IgrNumericYAxis  name="yAxis" />
    *
    *
    *     <IgrFinancialPriceSeries
    *     name="series2"
    *     xAxisName="xAxis"
    *     yAxisName="yAxis"
    *     displayType="Candlestick"
    *     lowMemberPath="Low"
    *     highMemberPath="High"
    *     openMemberPath="Open"
    *     closeMemberPath="Close"
    *     volumeMemberPath="Volume"
    * />
    *  </IgrDataChart>
    * ```
    *
    * ```ts
    * series.displayType=PriceDisplayType.Candlestick;
    * ```
    */
    get displayType() {
        return this.i.x7;
    }
    set displayType(v) {
        this.i.x7 = ensureEnum(PriceDisplayType_$type, v);
    }
    /**
     * Brush to use for outlining negative elements in the series.
    *
    * Use the `NegativeOutline` property to brush the outline negative elements in the series.
    *
    * ```ts
    * <IgrDataChart
    *     dataSource={this.state.dataSource}
    *     width="700px"
    *     height="500px">
    *
    *
    *     <IgrCategoryXAxis name="xAxis" label="Date" />
    *     <IgrNumericYAxis  name="yAxis" />
    *
    *
    *     <IgrFinancialPriceSeries
    *     name="series2"
    *     xAxisName="xAxis"
    *     yAxisName="yAxis"
    *     displayType="Candlestick"
    *     lowMemberPath="Low"
    *     highMemberPath="High"
    *     openMemberPath="Open"
    *     closeMemberPath="Close"
    *     volumeMemberPath="Volume"
    * 	negativeOutline="Red" />
    *  </IgrDataChart>
    * ```
    *
    * ```ts
    * series.negativeOutline="red";
    * ```
    */
    get negativeOutline() {
        return brushToString(this.i.zj);
    }
    set negativeOutline(v) {
        this.i.zj = stringToBrush(v);
    }
    /**
     * Gets or sets the label displayed before series' Low value in the Data Legend.
    */
    get lowMemberAsLegendLabel() {
        return this.i.yn;
    }
    set lowMemberAsLegendLabel(v) {
        this.i.yn = v;
    }
    /**
     * Gets or sets the label displayed before series' High value in the Data Legend.
    */
    get highMemberAsLegendLabel() {
        return this.i.yj;
    }
    set highMemberAsLegendLabel(v) {
        this.i.yj = v;
    }
    /**
     * Gets or sets the label displayed before series' Close value in the Data Legend.
    */
    get closeMemberAsLegendLabel() {
        return this.i.ye;
    }
    set closeMemberAsLegendLabel(v) {
        this.i.ye = v;
    }
    /**
     * Gets or sets the label displayed before series' Open value in the Data Legend.
    */
    get openMemberAsLegendLabel() {
        return this.i.ys;
    }
    set openMemberAsLegendLabel(v) {
        this.i.ys = v;
    }
    /**
     * Gets or sets the unit displayed after series' Low value in the Data Legend.
    */
    get lowMemberAsLegendUnit() {
        return this.i.yp;
    }
    set lowMemberAsLegendUnit(v) {
        this.i.yp = v;
    }
    /**
     * Gets or sets the unit displayed after series' High value in the Data Legend.
    */
    get highMemberAsLegendUnit() {
        return this.i.yl;
    }
    set highMemberAsLegendUnit(v) {
        this.i.yl = v;
    }
    /**
     * Gets or sets the unit displayed after series' Close value in the Data Legend.
    */
    get closeMemberAsLegendUnit() {
        return this.i.yg;
    }
    set closeMemberAsLegendUnit(v) {
        this.i.yg = v;
    }
    /**
     * Gets or sets the unit displayed after series' Open value in the Data Legend.
    */
    get openMemberAsLegendUnit() {
        return this.i.yu;
    }
    set openMemberAsLegendUnit(v) {
        this.i.yu = v;
    }
    /**
     * 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.
    */
    getSeriesValueBoundingBox(world) {
        let iv = this.i.tu(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.
    */
    scrollIntoView(item) {
        let iv = this.i.fp(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
    */
    getItemSpan() {
        let iv = this.i.h1();
        return (iv);
    }
    setNegativeColors(negativeBrush, negativeOutline) {
        this.i.p1(stringToBrush(negativeBrush), stringToBrush(negativeOutline));
    }
    /**
     * Gets a numeric value from the numeric axis associated with this series that matches the desired
     * value mode.
    
    * @param mode  * The type of value desired from the series numeric axis.
    */
    getSeriesValueType(mode) {
        let iv = this.i.am((mode == null ? null : mode));
        return (iv);
    }
    getSeriesValueTypePosition(mode) {
        let iv = this.i.tm((mode == null ? null : mode));
        return fromPoint(iv);
    }
    getSeriesValueTypePositionFromValue(values) {
        let iv = this.i.tn(values);
        return fromPoint(iv);
    }
}
