UNPKG

igniteui-angular-charts

Version:

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

316 lines (313 loc) 12.9 kB
import { __extends } from "tslib"; import { Component, forwardRef, Input, ChangeDetectionStrategy } from '@angular/core'; import { IgxHorizontalAnchoredCategorySeriesComponent } from "./igx-horizontal-anchored-category-series-component"; import { IgxAnchoredCategorySeriesComponent } from "./igx-anchored-category-series-component"; import { IgxCategorySeriesComponent } from "./igx-category-series-component"; import { IgxMarkerSeriesComponent } from "./igx-marker-series-component"; import { IgxSeriesComponent } from "./igx-series-component"; import { WaterfallSeries } from "./WaterfallSeries"; import { brushToString, stringToBrush, toPoint, fromRect } from "igniteui-angular-core"; import * as i0 from "@angular/core"; /** * Represents a IgxDataChartComponent waterfall column series. * * `WaterfallSeries` belongs to a group of `CategorySeries` and it is rendered using a collection of vertical columns that show the difference between consecutive data points. * * ```html * <igx-data-chart * [dataSource]="data"> * <igx-category-x-axis #xAxis * label="label"> * </igx-category-x-axis> * <igx-numeric-y-axis #yAxis> * </igx-numeric-y-axis> * <igx-waterfall-series * [xAxis]="xAxis" * [yAxis]="yAxis" * valueMemberPath="value"> * </igx-waterfall-series> * </igx-data-chart> * ``` * * ```ts * let series: IgxWaterfallSeriesComponent = new IgxWaterfallSeriesComponent(); * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.valueMemberPath = "value"; * this.chart.series.add(series); * ``` */ var IgxWaterfallSeriesComponent = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgxWaterfallSeriesComponent, _super); function IgxWaterfallSeriesComponent() { return _super.call(this) || this; } IgxWaterfallSeriesComponent.prototype.createImplementation = function () { return new WaterfallSeries(); }; Object.defineProperty(IgxWaterfallSeriesComponent.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); Object.defineProperty(IgxWaterfallSeriesComponent.prototype, "isWaterfall", { /** * Gets whether the current series shows a waterfall column shape. */ get: function () { return this.i.gc; }, enumerable: false, configurable: true }); Object.defineProperty(IgxWaterfallSeriesComponent.prototype, "isMarkerlessDisplayPreferred", { /** * Overridden by derived series classes to indicate when marker-less display is preferred or not. */ get: function () { return this.i.fo; }, enumerable: false, configurable: true }); Object.defineProperty(IgxWaterfallSeriesComponent.prototype, "isFinancialWaterfall", { /** * Gets whether the series is financial waterfall */ get: function () { return this.i.fe; }, enumerable: false, configurable: true }); Object.defineProperty(IgxWaterfallSeriesComponent.prototype, "isNegativeColorSupported", { /** * Overridden by derived series classes to indicate when negative colors are supported or not. */ get: function () { return this.i.fp; }, enumerable: false, configurable: true }); Object.defineProperty(IgxWaterfallSeriesComponent.prototype, "negativeBrush", { /** * Gets or sets the brush to use for negative portions of the series. * * Gets or sets the color used to draw negative declines in values for this `WaterfallSeries`. * * ```html * <igx-data-chart * [dataSource]="data"> * <igx-category-x-axis #xAxis * label="label"> * </igx-category-x-axis> * <igx-numeric-y-axis #yAxis> * </igx-numeric-y-axis> * <igx-waterfall-series * [xAxis]="xAxis" * [yAxis]="yAxis" * negativeBrush="#ff0000" * valueMemberPath="value"> * </igx-waterfall-series> * </igx-data-chart> * ``` * * ```ts * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.valueMemberPath = "value"; * series.negativeBrush = "#ff0000"; * this.chart.series.add(series); * ``` */ get: function () { return brushToString(this.i.adu); }, set: function (v) { this.i.adu = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgxWaterfallSeriesComponent.prototype, "radiusX", { /** * Gets or sets the x-radius of the ellipse that is used to round the corners of the column. * * Gets or sets the amount to round corners in the direction of the X axis in this series. * * ```html * <igx-data-chart * [dataSource]="data"> * <igx-category-x-axis #xAxis * label="label"> * </igx-category-x-axis> * <igx-numeric-y-axis #yAxis> * </igx-numeric-y-axis> * <igx-waterfall-series * [xAxis]="xAxis" * [yAxis]="yAxis" * radiusX="15" * radiusY="15" * valueMemberPath="value"> * </igx-waterfall-series> * </igx-data-chart> * ``` * * ```ts * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.valueMemberPath = "value"; * series.radiusX = 15; * series.radiusY = 15; * this.chart.series.add(series); * ``` */ get: function () { return this.i.adk; }, set: function (v) { this.i.adk = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxWaterfallSeriesComponent.prototype, "radiusY", { /** * Gets or sets the y-radius of the ellipse that is used to round the corners of the column. * * Gets or sets the amount to round corners in the direction of the Y axis in this series. * * ```html * <igx-data-chart * [dataSource]="data"> * <igx-category-x-axis #xAxis * label="label"> * </igx-category-x-axis> * <igx-numeric-y-axis #yAxis> * </igx-numeric-y-axis> * <igx-waterfall-series * [xAxis]="xAxis" * [yAxis]="yAxis" * radiusX="15" * radiusY="15" * valueMemberPath="value"> * </igx-waterfall-series> * </igx-data-chart> * ``` * * ```ts * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.valueMemberPath = "value"; * series.radiusX = 15; * series.radiusY = 15; * this.chart.series.add(series); * ``` */ get: function () { return this.i.adl; }, set: function (v) { this.i.adl = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgxWaterfallSeriesComponent.prototype, "negativeOutline", { /** * Brush to use for outlining negative elements in the waterfall series. * * Gets or sets the color used to draw borders of negative declines in values for this `WaterfallSeries`. * * ```html * <igx-data-chart * [dataSource]="data"> * <igx-category-x-axis #xAxis * label="label"> * </igx-category-x-axis> * <igx-numeric-y-axis #yAxis> * </igx-numeric-y-axis> * <igx-waterfall-series * [xAxis]="xAxis" * [yAxis]="yAxis" * negativeOutline="#ff0000" * valueMemberPath="value"> * </igx-waterfall-series> * </igx-data-chart> * ``` * * ```ts * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.valueMemberPath = "value"; * series.negativeOutline = "#ff0000"; * this.chart.series.add(series); * ``` */ get: function () { return brushToString(this.i.adv); }, set: function (v) { this.i.adv = stringToBrush(v); }, enumerable: false, configurable: true }); IgxWaterfallSeriesComponent.prototype.setNegativeColors = function (negativeBrush, negativeOutline) { this.i.sl(stringToBrush(negativeBrush), stringToBrush(negativeOutline)); }; /** * 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 * * Returns a bounding box `Rect` for a data value given a `Point`. * * ```ts * let box : IgxRect = series.getSeriesValueBoundingBox({x: 4, y: 7}); * ``` */ IgxWaterfallSeriesComponent.prototype.getSeriesValueBoundingBox = function (world) { var iv = this.i.w8(toPoint(world)); return fromRect(iv); }; /** * For a category plotted series, returns the current width of the items within the categories. This only returns a value if the items have some form of width (e.g. columns, bars, etc.) otherwise 0 is returned. * * Returns the width of items in the `WaterfallSeries`. * * ```ts * let itemSpan: number = series.GetItemSpan(); * ``` */ IgxWaterfallSeriesComponent.prototype.getItemSpan = function () { var iv = this.i.i3(); return (iv); }; IgxWaterfallSeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxWaterfallSeriesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); IgxWaterfallSeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxWaterfallSeriesComponent, selector: "igx-waterfall-series", inputs: { negativeBrush: "negativeBrush", radiusX: "radiusX", radiusY: "radiusY", negativeOutline: "negativeOutline" }, providers: [{ provide: IgxHorizontalAnchoredCategorySeriesComponent, useExisting: forwardRef(function () { return IgxWaterfallSeriesComponent; }) }, { provide: IgxAnchoredCategorySeriesComponent, useExisting: forwardRef(function () { return IgxWaterfallSeriesComponent; }) }, { provide: IgxCategorySeriesComponent, useExisting: forwardRef(function () { return IgxWaterfallSeriesComponent; }) }, { provide: IgxMarkerSeriesComponent, useExisting: forwardRef(function () { return IgxWaterfallSeriesComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxWaterfallSeriesComponent; }) }], usesInheritance: true, ngImport: i0, template: "", isInline: true, changeDetection: i0.ChangeDetectionStrategy.OnPush }); return IgxWaterfallSeriesComponent; }(IgxHorizontalAnchoredCategorySeriesComponent)); export { IgxWaterfallSeriesComponent }; i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxWaterfallSeriesComponent, decorators: [{ type: Component, args: [{ selector: 'igx-waterfall-series', template: "", providers: [{ provide: IgxHorizontalAnchoredCategorySeriesComponent, useExisting: forwardRef(function () { return IgxWaterfallSeriesComponent; }) }, { provide: IgxAnchoredCategorySeriesComponent, useExisting: forwardRef(function () { return IgxWaterfallSeriesComponent; }) }, { provide: IgxCategorySeriesComponent, useExisting: forwardRef(function () { return IgxWaterfallSeriesComponent; }) }, { provide: IgxMarkerSeriesComponent, useExisting: forwardRef(function () { return IgxWaterfallSeriesComponent; }) }, { provide: IgxSeriesComponent, useExisting: forwardRef(function () { return IgxWaterfallSeriesComponent; }) }], changeDetection: ChangeDetectionStrategy.OnPush }] }], ctorParameters: function () { return []; }, propDecorators: { negativeBrush: [{ type: Input }], radiusX: [{ type: Input }], radiusY: [{ type: Input }], negativeOutline: [{ type: Input }] } });