UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

108 lines (107 loc) 3.04 kB
import { IgrStrategyBasedIndicator } from "./igr-strategy-based-indicator"; import { ForceIndexIndicator } from "./ForceIndexIndicator"; /** * Represents a IgxDataChartComponent Force Index indicator series. * Default required members: Close, Volume * * The `ForceIndexIndicator` represents a IgxDataChartComponent Force Index indicator series. * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} * width="700px" * height="500px"> * * * <IgrCategoryXAxis name="xAxis" label="Date" /> * <IgrNumericYAxis name="yAxis" /> * * * <IgrForceIndexIndicator * name="series2" * xAxisName="xAxis" * yAxisName="yAxis" * displayType="Candlestick" * lowMemberPath="Low" * highMemberPath="High" * openMemberPath="Open" * closeMemberPath="Close" * volumeMemberPath="Volume" /> * </IgrDataChart> * ``` * * ```ts * this.financialSeries = new IgrForceIndexIndicator({name: "financialSeries"}); * this.financialSeries.dataSource = this.financialData; * this.financialSeries.xAxis = this.timeXAxis; * this.financialSeries.yAxis = this.numericYAxis; * this.financialSeries.xAxisName = "timeXAxis"; * this.financialSeries.yAxisName = "numericYAxis"; * this.financialSeries.highMemberPath="High" * this.financialSeries.lowMemberPath="Low" * this.financialSeries.closeMemberPath="Close" * this.financialSeries.openMemberPath="Open" * this.financialSeries.volumeMemberPath="Volume" * ``` */ export class IgrForceIndexIndicator extends IgrStrategyBasedIndicator { createImplementation() { return new ForceIndexIndicator(); } /** * @hidden */ get i() { return this._implementation; } constructor(props) { super(props); } /** * Gets default display type for the current Financial Indicator */ get defaultDisplayType() { return this.i.aa7; } /** * Gets or sets the moving average period for the current AverageTrueRangeSeries object. * The typical, and initial, value for ForceIndiex periods is 0. * * You can use the `period` property to get the moving average period of the current FullStochasticOscillatorIndicator object * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} * width="700px" * height="500px"> * * * <IgrCategoryXAxis name="xAxis" label="Date" /> * <IgrNumericYAxis name="yAxis" /> * * * <IgrForceIndexIndicator * name="series2" * xAxisName="xAxis" * yAxisName="yAxis" * displayType="Candlestick" * lowMemberPath="Low" * highMemberPath="High" * openMemberPath="Open" * closeMemberPath="Close" * volumeMemberPath="Volume" * period= {30} /> * </IgrDataChart> * ``` * * ```ts * this.series.period = 30; * ``` */ get period() { return this.i.acl; } set period(v) { this.i.acl = +v; } }