UNPKG

igniteui-react-charts

Version:

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

105 lines (104 loc) 2.94 kB
import { IgrFinancialOverlay } from "./igr-financial-overlay"; import { PriceChannelOverlay } from "./PriceChannelOverlay"; import { toPoint } from "igniteui-react-core"; /** * Represents a IgxDataChartComponent Financial Price Channel Overlay series. * Default required members: High, Low * * You can use the `PriceChannelOverlay` to display price volatility. * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} * width="700px" * height="500px"> * * <IgrCategoryXAxis name="xAxis" label="Date" /> * <IgrNumericYAxis name="yAxis" /> * <IgrPriceChannelOverlay * name="series1" * xAxisName="xAxis" * yAxisName="yAxis" * lowMemberPath="Low" * highMemberPath="High" * openMemberPath="Open" * closeMemberPath="Close" * volumeMemberPath="Volume" /> * </IgrDataChart> * ``` * * ```ts * let series = new IgrPriceChannelOverlay({name:"series1"}); * series.xAxisName = this.xAxis; * series.yAxisName = this.yAxis; * series.xAxis = this.categoryXAxis; * series.yAxis = this.numericYAxis; * series.openMemberPath = "open"; * series.highMemberPath = "high"; * series.lowMemberPath = "low"; * series.closeMemberPath = "close"; * ``` */ export class IgrPriceChannelOverlay extends IgrFinancialOverlay { createImplementation() { return new PriceChannelOverlay(); } /** * @hidden */ get i() { return this._implementation; } constructor(props) { super(props); } /** * Gets or sets the moving average period for the current PriceChannelOverlay object. * The typical, and initial, value for Bollinger band periods is 14. * * You can use the `Period` to set the moving average. * * ```ts * this.series.period = 14; * ``` * * ```ts * <IgrDataChart * dataSource={this.state.dataSource} * width="700px" * height="500px"> * * <IgrCategoryXAxis name="xAxis" label="Date" /> * <IgrNumericYAxis name="yAxis" /> * <IgrPriceChannelOverlay * name="series1" * xAxisName="xAxis" * yAxisName="yAxis" * lowMemberPath="Low" * highMemberPath="High" * openMemberPath="Open" * closeMemberPath="Close" * volumeMemberPath="Volume" * period = {14} /> * </IgrDataChart> * ``` */ get period() { return this.i.abd; } set period(v) { this.i.abd = +v; } getSeriesValue(world, useInterpolation, skipUnknowns) { let iv = this.i.i6(toPoint(world), useInterpolation, skipUnknowns); return (iv); } getNextOrExactIndex(world, skipUnknowns) { let iv = this.i.j9(toPoint(world), skipUnknowns); return (iv); } getPreviousOrExactIndex(world, skipUnknowns) { let iv = this.i.kb(toPoint(world), skipUnknowns); return (iv); } }