igniteui-react-charts
Version:
Ignite UI React charting components for building rich data visualizations using TypeScript APIs.
96 lines (95 loc) • 2.7 kB
JavaScript
import { IgrStrategyBasedIndicator } from "./igr-strategy-based-indicator";
import { RelativeStrengthIndexIndicator } from "./RelativeStrengthIndexIndicator";
/**
* Represents a IgxDataChartComponent Relative Strength Index indicator series.
* Default required members: Close
*
* The `RelativeStrengthIndexIndicator` class represents Relative Strength Index indicator series for the IgxDataChartComponent .
*
* ```ts
* <IgrDataChart
* dataSource={this.state.dataSource}
* width="700px"
* height="500px">
*
* <IgrCategoryXAxis name="xAxis" label="Year" />
* <IgrNumericYAxis name="yAxis" />
*
* <IgrRelativeStrengthIndexIndicator
* name="series1"
* xAxisName="xAxis"
* yAxisName="yAxis"
* openMemberPath="Open"
* volumeMemberPath="Volume"
* highMemberPath="High"
* lowMemberPath="Low" />
* </IgrDataChart>
* ```
*
* ```ts
* let series = new IgrRelativeStrengthIndexIndicator({name :"series"});
* series.xAxis = this.xAxis;
* series.yAxis = this.yAxis;
* series.openMemberPath = "open";
* series.highMemberPath = "high";
* series.lowMemberPath = "low";
* series.closeMemberPath = "close";
* ```
*/
export class IgrRelativeStrengthIndexIndicator extends IgrStrategyBasedIndicator {
createImplementation() {
return new RelativeStrengthIndexIndicator();
}
/**
* @hidden
*/
get i() {
return this._implementation;
}
constructor(props) {
super(props);
}
/**
* Gets default display type for the current Financial Indicator
*/
get defaultDisplayType() {
return this.i.abd;
}
/**
* Gets or sets the moving average period for the current RelativeStrengthIndexIndicator object.
* The typical, and initial, value for RSI periods is 14.
*
* You can use the `period` property for the current RelativeStrengthIndexIndicator object.
*
* ```ts
* <IgrDataChart
* dataSource={this.state.dataSource}
* width="700px"
* height="500px">
*
* <IgrCategoryXAxis name="xAxis" label="Year" />
* <IgrNumericYAxis name="yAxis" />
*
* <IgrRelativeStrengthIndexIndicator
* name="series1"
* xAxisName="xAxis"
* yAxisName="yAxis"
* openMemberPath="Open"
* volumeMemberPath="Volume"
* highMemberPath="High"
* lowMemberPath="Low"
* period=30 />
* </IgrDataChart>
* ```
*
* ```ts
* this.series.period = 30;
* ```
*/
get period() {
return this.i.acr;
}
set period(v) {
this.i.acr = +v;
}
}