UNPKG

igniteui-webcomponents-charts

Version:

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

203 lines (200 loc) 7.61 kB
import { IgcHorizontalAnchoredCategorySeriesComponent } from "./igc-horizontal-anchored-category-series-component"; import { WaterfallSeries } from "./WaterfallSeries"; import { getAllPropertyNames, toSpinal, brushToString, stringToBrush, toPoint, fromRect } from "igniteui-webcomponents-core"; import { RegisterElementHelper } from "igniteui-webcomponents-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. */ export let IgcWaterfallSeriesComponent = /*@__PURE__*/ (() => { class IgcWaterfallSeriesComponent extends IgcHorizontalAnchoredCategorySeriesComponent { createImplementation() { return new WaterfallSeries(); } /** * @hidden */ get i() { return this._implementation; } constructor() { super(); } connectedCallback() { if (super["connectedCallback"]) { super["connectedCallback"](); } if (this.i.connectedCallback) { this.i.connectedCallback(); } if (!this._attached) { this._attached = true; this._flushQueuedAttributes(); } } disconnectedCallback() { if (super["disconnectedCallback"]) { super["disconnectedCallback"](); } if (this.i.disconnectedCallback) { this.i.disconnectedCallback(); } if (this._attached) { this._attached = false; } } static get observedAttributes() { if (IgcWaterfallSeriesComponent._observedAttributesIgcWaterfallSeriesComponent == null) { let names = getAllPropertyNames(IgcWaterfallSeriesComponent); for (let i = 0; i < names.length; i++) { names[i] = toSpinal(names[i]); } IgcWaterfallSeriesComponent._observedAttributesIgcWaterfallSeriesComponent = names; } return IgcWaterfallSeriesComponent._observedAttributesIgcWaterfallSeriesComponent; } static register() { if (!IgcWaterfallSeriesComponent._isElementRegistered) { IgcWaterfallSeriesComponent._isElementRegistered = true; RegisterElementHelper.registerElement(IgcWaterfallSeriesComponent.htmlTagName, IgcWaterfallSeriesComponent); } } /** * Gets whether the current series shows a waterfall column shape. */ get isWaterfall() { return this.i.f7; } /** * Overridden by derived series classes to indicate when marker-less display is preferred or not. */ get isMarkerlessDisplayPreferred() { return this.i.fm; } /** * Gets whether the series is financial waterfall */ get isFinancialWaterfall() { return this.i.fc; } /** * Overridden by derived series classes to indicate when negative colors are supported or not. */ get isNegativeColorSupported() { return this.i.fn; } /** * 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`. * * ```ts * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.valueMemberPath = "value"; * series.negativeBrush = "#ff0000"; * this.chart.series.add(series); * ``` */ get negativeBrush() { return brushToString(this.i.ade); } set negativeBrush(v) { this.i.ade = stringToBrush(v); this._a("negativeBrush", brushToString(this.i.ade)); } /** * 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. * * ```ts * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.valueMemberPath = "value"; * series.radiusX = 15; * series.radiusY = 15; * this.chart.series.add(series); * ``` */ get radiusX() { return this.i.ac4; } set radiusX(v) { this.i.ac4 = +v; this._a("radiusX", this.i.ac4); } /** * 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. * * ```ts * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.valueMemberPath = "value"; * series.radiusX = 15; * series.radiusY = 15; * this.chart.series.add(series); * ``` */ get radiusY() { return this.i.ac5; } set radiusY(v) { this.i.ac5 = +v; this._a("radiusY", this.i.ac5); } /** * 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`. * * ```ts * series.xAxis = this.xAxis; * series.yAxis = this.yAxis; * series.valueMemberPath = "value"; * series.negativeOutline = "#ff0000"; * this.chart.series.add(series); * ``` */ get negativeOutline() { return brushToString(this.i.adf); } set negativeOutline(v) { this.i.adf = stringToBrush(v); this._a("negativeOutline", brushToString(this.i.adf)); } setNegativeColors(negativeBrush, negativeOutline) { this.i.r7(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`. */ getSeriesValueBoundingBox(world) { let iv = this.i.ws(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(); * ``` */ getItemSpan() { let iv = this.i.ix(); return (iv); } } IgcWaterfallSeriesComponent._observedAttributesIgcWaterfallSeriesComponent = null; IgcWaterfallSeriesComponent.htmlTagName = "igc-waterfall-series"; IgcWaterfallSeriesComponent._isElementRegistered = false; return IgcWaterfallSeriesComponent; })();