UNPKG

igniteui-angular-charts

Version:

Ignite UI Angular charting components for building rich data visualizations for modern web apps.

88 lines (87 loc) 5.03 kB
import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core'; import { IgxStrategyBasedIndicatorComponent } from "./igx-strategy-based-indicator-component"; import { IgxFinancialIndicatorComponent } from "./igx-financial-indicator-component"; import { IgxFinancialSeriesComponent } from "./igx-financial-series-component"; import { IgxSeriesComponent } from "./igx-series-component"; import { StandardDeviationIndicator } from "./StandardDeviationIndicator"; import * as i0 from "@angular/core"; /** * 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`. * * ```html * <igx-data-chart * width=500px * height=500px * [dataSource]="data" > * <igx-ordinal-time-x-axis * dateTimeMemberPath="TimeStamp" * #xAxis> * </igx-ordinal-time-x-axis> * <igx-numeric-y-axis * #yAxis></igx-numeric-y-axis> * <igx-standard-deviation-indicator * [xAxis]="xAxis" * [yAxis]="yAxis" * closeMemberPath="Close" * highMemberPath="High" * lowMemberPath="Low"> * </igx-standard-deviation-indicator> * </igx-data-chart> * ``` * * ```ts * let series = new IgxStandardDeviatioIndicatorComponent(); * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.highMemberPath = "high"; * series.lowMemberPath = "low"; * series.closeMemberPath = "close"; * this.chart.series.add(series); * * ``` */ export let IgxStandardDeviationIndicatorComponent = /*@__PURE__*/ (() => { class IgxStandardDeviationIndicatorComponent extends IgxStrategyBasedIndicatorComponent { constructor() { super(); } createImplementation() { return new StandardDeviationIndicator(); } /** * @hidden */ get i() { return this._implementation; } /** * 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.acf; } set period(v) { this.i.acf = +v; } } IgxStandardDeviationIndicatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxStandardDeviationIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); IgxStandardDeviationIndicatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxStandardDeviationIndicatorComponent, selector: "igx-standard-deviation-indicator", inputs: { period: "period" }, providers: [{ provide: IgxStrategyBasedIndicatorComponent, useExisting: forwardRef(() => IgxStandardDeviationIndicatorComponent) }, { provide: IgxFinancialIndicatorComponent, useExisting: forwardRef(() => IgxStandardDeviationIndicatorComponent) }, { provide: IgxFinancialSeriesComponent, useExisting: forwardRef(() => IgxStandardDeviationIndicatorComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxStandardDeviationIndicatorComponent) }], usesInheritance: true, ngImport: i0, template: ``, isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); return IgxStandardDeviationIndicatorComponent; })(); i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxStandardDeviationIndicatorComponent, decorators: [{ type: Component, args: [{ selector: 'igx-standard-deviation-indicator', template: ``, providers: [{ provide: IgxStrategyBasedIndicatorComponent, useExisting: forwardRef(() => IgxStandardDeviationIndicatorComponent) }, { provide: IgxFinancialIndicatorComponent, useExisting: forwardRef(() => IgxStandardDeviationIndicatorComponent) }, { provide: IgxFinancialSeriesComponent, useExisting: forwardRef(() => IgxStandardDeviationIndicatorComponent) }, { provide: IgxSeriesComponent, useExisting: forwardRef(() => IgxStandardDeviationIndicatorComponent) }], changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: function () { return []; }, propDecorators: { period: [{ type: Input }] } });