UNPKG

igniteui-angular-charts

Version:

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

127 lines (126 loc) 6.32 kB
import { __extends } from "tslib"; import { EventEmitter, Output, Component, forwardRef, 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 { CustomIndicator } from "./CustomIndicator"; import { IgxFinancialEventArgs } from "./igx-financial-event-args"; import { delegateCombine } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Represents a IgxDataChartComponent Custom Indicator series. * The indicator value is calculated in the user specified Indicator event handler. * * `CustomIndicator` class specify the series as Custom Indicator series. * * ```html * <igx-data-chart [dataSource]="data"> * <igx-category-x-axis #xAxis * label="time"> * </igx-category-x-axis> * <igx-numeric-y-axis #yAxis> * </igx-numeric-y-axis> * <igx-commodity-channel-index-indicator * [xAxis]="xAxis" * [yAxis]="yAxis" * openMemberPath="open" * highMemberPath="high" * lowMemberPath="low" * closeMemberPath="close" * volumeMemberPath="volume" > * </igx-commodity-channel-index-indicator> * </igx-data-chart> * ``` * * ```ts * let series = new IgxCustomIndicatorComponent(); * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.openMemberPath = "open"; * series.highMemberPath = "high"; * series.lowMemberPath = "low"; * series.closeMemberPath = "close"; * this.chart.series.add(series); * ``` */ var IgxCustomIndicatorComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgxCustomIndicatorComponent, _super); function IgxCustomIndicatorComponent() { var _this = _super.call(this) || this; _this._indicator = null; _this._basedOnColumns = null; return _this; } IgxCustomIndicatorComponent.prototype.createImplementation = function () { return new CustomIndicator(); }; Object.defineProperty(IgxCustomIndicatorComponent.prototype, "i", { get: function () { return this._implementation; }, enumerable: false, configurable: true }); Object.defineProperty(IgxCustomIndicatorComponent.prototype, "indicator", { /** * This event is raised when the indicator values need to be computed. */ get: function () { var _this = this; if (this._indicator == null) { this._indicator = new EventEmitter(); this.i.indicator = delegateCombine(this.i.indicator, function (o, e) { var outerArgs = new IgxFinancialEventArgs(); outerArgs._provideImplementation(e); _this._indicator.emit({ sender: _this, args: outerArgs }); }); } return this._indicator; }, enumerable: false, configurable: true }); Object.defineProperty(IgxCustomIndicatorComponent.prototype, "basedOnColumns", { /** * This event is raised when the based on columns to be specified. */ get: function () { var _this = this; if (this._basedOnColumns == null) { this._basedOnColumns = new EventEmitter(); this.i.basedOnColumns = delegateCombine(this.i.indicator, function (o, e) { var outerArgs = new IgxFinancialEventArgs(); outerArgs._provideImplementation(e); _this._basedOnColumns.emit({ sender: _this, args: outerArgs }); }); } return this._indicator; }, enumerable: false, configurable: true }); IgxCustomIndicatorComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxCustomIndicatorComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); IgxCustomIndicatorComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxCustomIndicatorComponent, selector: "igx-custom-indicator", outputs: { indicator: "indicator", basedOnColumns: "basedOnColumns" }, providers: [{ provide: IgxStrategyBasedIndicatorComponent, useExisting: forwardRef(function () { return IgxCustomIndicatorComponent; }) }, { provide: IgxFinancialIndicatorComponent, useExisting: forwardRef(function () { return IgxCustomIndicatorComponent; }) }, { provide: IgxFinancialSeriesComponent, useExisting: forwardRef(function () { return IgxCustomIndicatorComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxCustomIndicatorComponent; }) }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); return IgxCustomIndicatorComponent; }(IgxStrategyBasedIndicatorComponent)); export { IgxCustomIndicatorComponent }; i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxCustomIndicatorComponent, decorators: [{ type: Component, args: [{ selector: 'igx-custom-indicator', template: "", providers: [{ provide: IgxStrategyBasedIndicatorComponent, useExisting: forwardRef(function () { return IgxCustomIndicatorComponent; }) }, { provide: IgxFinancialIndicatorComponent, useExisting: forwardRef(function () { return IgxCustomIndicatorComponent; }) }, { provide: IgxFinancialSeriesComponent, useExisting: forwardRef(function () { return IgxCustomIndicatorComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxCustomIndicatorComponent; }) }], changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: function () { return []; }, propDecorators: { indicator: [{ type: Output }], basedOnColumns: [{ type: Output }] } });