UNPKG

igniteui-webcomponents-charts

Version:

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

271 lines (268 loc) 10.7 kB
import { __extends } from "tslib"; import { IndicatorDisplayType_$type } from "./IndicatorDisplayType"; import { TrendLineType_$type } from "igniteui-webcomponents-core"; import { IgcFinancialSeriesComponent } from "./igc-financial-series-component"; import { getAllPropertyNames, toSpinal, ensureEnum, enumToString, brushToString, stringToBrush, toDoubleCollection, fromDoubleCollection, doubleCollectionToString, toPoint, fromRect } from "igniteui-webcomponents-core"; /** * Represents the base functionality for a IgxDataChartComponent financial indicator series. * * The `FinancialIndicator` class represents the base functionality for a IgxDataChartComponent financial indicator series. */ var IgcFinancialIndicatorComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgcFinancialIndicatorComponent, _super); function IgcFinancialIndicatorComponent() { return _super.call(this) || this; } Object.defineProperty(IgcFinancialIndicatorComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); IgcFinancialIndicatorComponent.prototype.connectedCallback = function () { if (_super.prototype["connectedCallback"]) { _super.prototype["connectedCallback"].call(this); } if (this.i.connectedCallback) { this.i.connectedCallback(); } if (!this._attached) { this._attached = true; this._flushQueuedAttributes(); } }; IgcFinancialIndicatorComponent.prototype.disconnectedCallback = function () { if (_super.prototype["disconnectedCallback"]) { _super.prototype["disconnectedCallback"].call(this); } if (this.i.disconnectedCallback) { this.i.disconnectedCallback(); } if (this._attached) { this._attached = false; } }; Object.defineProperty(IgcFinancialIndicatorComponent, "observedAttributes", { get: function () { if (IgcFinancialIndicatorComponent._observedAttributesIgcFinancialIndicatorComponent == null) { var names = getAllPropertyNames(IgcFinancialIndicatorComponent); for (var i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcFinancialIndicatorComponent._observedAttributesIgcFinancialIndicatorComponent = names; } return IgcFinancialIndicatorComponent._observedAttributesIgcFinancialIndicatorComponent; }, enumerable: false, configurable: true }); Object.defineProperty(IgcFinancialIndicatorComponent.prototype, "isFinancialIndicator", { /** * Gets whether the series is financial indicator */ get: function () { return this.i.e9; }, enumerable: false, configurable: true }); Object.defineProperty(IgcFinancialIndicatorComponent.prototype, "displayType", { /** * Gets or sets the display for the current FinancialIndicator object. * * The `DisplayType` property is used to display the current FinancialIndicator object. * * ```ts * series.displayType= IndicatorDisplayType.Column; * ``` */ get: function () { return this.i.aa8; }, set: function (v) { this.i.aa8 = ensureEnum(IndicatorDisplayType_$type, v); this._a("displayType", enumToString(IndicatorDisplayType_$type, this.i.aa8)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcFinancialIndicatorComponent.prototype, "defaultDisplayType", { /** * Gets default display type for the current Financial Indicator */ get: function () { return this.i.aa7; }, enumerable: false, configurable: true }); Object.defineProperty(IgcFinancialIndicatorComponent.prototype, "ignoreFirst", { /** * Gets or sets the number of values to hide at the beginning of the indicator. * * Use the `IgnoreFirst` propert to hide the number of values at the beginning of the indicator. * * ```ts * series.ignoreFirst = 2; * ``` */ get: function () { return this.i.abe; }, set: function (v) { this.i.abe = +v; this._a("ignoreFirst", this.i.abe); }, enumerable: false, configurable: true }); Object.defineProperty(IgcFinancialIndicatorComponent.prototype, "trendLineType", { /** * Gets or sets the trend type for the current indicator series. * * Use `TrendLineType` property to get the trend type for the current indicator series. * * ```ts * series.trendLineType= TrendLineType.CubicFit; * ``` */ get: function () { return this.i.trendLineType; }, set: function (v) { this.i.trendLineType = ensureEnum(TrendLineType_$type, v); this._a("trendLineType", enumToString(TrendLineType_$type, this.i.trendLineType)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcFinancialIndicatorComponent.prototype, "trendLineBrush", { /** * Gets or sets the brush to use to draw the trend line. * * Use the `TrendLineBrush` propert to draw the trend line. */ get: function () { return brushToString(this.i.trendLineBrush); }, set: function (v) { this.i.trendLineBrush = stringToBrush(v); this._a("trendLineBrush", brushToString(this.i.trendLineBrush)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcFinancialIndicatorComponent.prototype, "actualTrendLineBrush", { /** * Gets the effective TrendLineBrush for this indicator. * * Use the `ActualTrendLineBrush` property to Gets the effective TrendLineBrush for the FinancialIndicator. */ get: function () { return brushToString(this.i.abw); }, set: function (v) { this.i.abw = stringToBrush(v); this._a("actualTrendLineBrush", brushToString(this.i.abw)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcFinancialIndicatorComponent.prototype, "trendLineThickness", { /** * Gets or sets the thickness of the current indicator object's trend line. * * Use `TrendLineThickness` property for the thickness of the current indicator object's trend line. * * ```ts * series.trendLineThickness=2 ; * ``` */ get: function () { return this.i.trendLineThickness; }, set: function (v) { this.i.trendLineThickness = +v; this._a("trendLineThickness", this.i.trendLineThickness); }, enumerable: false, configurable: true }); Object.defineProperty(IgcFinancialIndicatorComponent.prototype, "trendLineDashArray", { /** * Gets or sets a collection of double values that indicate the pattern of dashes and gaps that * is used to draw the trend line for the current indicator object. */ get: function () { return fromDoubleCollection(this.i.abx); }, set: function (v) { this.i.abx = toDoubleCollection(v); this._a("trendLineDashArray", doubleCollectionToString(this.i.abx)); }, enumerable: false, configurable: true }); Object.defineProperty(IgcFinancialIndicatorComponent.prototype, "trendLinePeriod", { /** * Gets or sets the trend line period for the current series. * The typical, and initial, value for trend line period is 7. * * Use `TrendLinePeriod` property for the trend line period of the current series. * * ```ts * series.trendLinePeriod =30; * ``` */ get: function () { return this.i.trendLinePeriod; }, set: function (v) { this.i.trendLinePeriod = +v; this._a("trendLinePeriod", this.i.trendLinePeriod); }, enumerable: false, configurable: true }); /** * If possible, will return the best available value bounding box within the series that has the best value match for the world position provided. * @param world * The world coordinate for which to get a value bounding box for * * The `GetSeriesValueBoundingBox` method returns the best available value bounding box within the series that has the best value match for the world position provided. */ IgcFinancialIndicatorComponent.prototype.getSeriesValueBoundingBox = function (world) { var iv = this.i.ws(toPoint(world)); return fromRect(iv); }; IgcFinancialIndicatorComponent.prototype.getSeriesValue = function (world, useInterpolation, skipUnknowns) { var iv = this.i.i6(toPoint(world), useInterpolation, skipUnknowns); return (iv); }; IgcFinancialIndicatorComponent.prototype.getPreviousOrExactIndex = function (world, skipUnknowns) { var iv = this.i.kb(toPoint(world), skipUnknowns); return (iv); }; IgcFinancialIndicatorComponent.prototype.getNextOrExactIndex = function (world, skipUnknowns) { var iv = this.i.j9(toPoint(world), skipUnknowns); return (iv); }; /** * Scrolls the series to display the item for the specified data item. * The series is scrolled by the minimum amount required to place the specified data item within * the central 80% of the visible axis. * @param item * The data item (item) to scroll to. * * The `ScrollIntoView` method scrolls the series to display the item for the specified data item. */ IgcFinancialIndicatorComponent.prototype.scrollIntoView = function (item) { var iv = this.i.ge(item); return (iv); }; IgcFinancialIndicatorComponent._observedAttributesIgcFinancialIndicatorComponent = null; return IgcFinancialIndicatorComponent; }(IgcFinancialSeriesComponent)); export { IgcFinancialIndicatorComponent };