UNPKG

igniteui-react-charts

Version:

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

63 lines (62 loc) 2.21 kB
import { IgrStrategyBasedIndicator } from "./igr-strategy-based-indicator"; import { StandardDeviationIndicator } from "./StandardDeviationIndicator"; /** * Represents a IgxDataChartComponent Standard Deviation indicator series. * Default required members: High, Low, Close * * `StandardDeviationIndicator` (SDI) measures statistical variation in stock prices or volatility. The difference between an individual security’s closing price and the average security closing price is called the dispersion. The larger the dispersion is the higher the standard deviation will be and therefore the volatility. The smaller the dispersion is (the difference between an individual closing price and the average price), the smaller the standard deviation and the lower the price volatility. * * Using this indicator requires setting both the `HighMemberPath`, `LowMemberPath` and `CloseMemberPath`. * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} * width="700px" * height="500px"> * * <IgrCategoryXAxis name="xAxis" label="Year" /> * <IgrNumericYAxis name="yAxis" /> * * <IgrStandardDeviationIndicator * name="series1" * xAxisName="xAxis" * yAxisName="yAxis" * closeMemberPath="Close" * highMemberPath="High" * lowMemberPath="Low" /> * </IgrDataChart> * ``` * * ```ts * let series = new IgrStandardDeviationIndicator({name:"series"}); * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.closeMemberPath="Close"; * series.highMemberPath="High"; * series.lowMemberPath="Low"; * ``` */ export class IgrStandardDeviationIndicator extends IgrStrategyBasedIndicator { createImplementation() { return new StandardDeviationIndicator(); } /** * @hidden */ get i() { return this._implementation; } constructor(props) { super(props); } /** * Gets or sets the moving average period for the current StandardDeviationIndicator object. * The typical, and initial, value for STDEV periods is 20. */ get period() { return this.i.acr; } set period(v) { this.i.acr = +v; } }