UNPKG

scichart

Version:

Fast WebGL JavaScript Charting Library and Framework

62 lines (61 loc) 3.29 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.PolarStackedColumnCollection = void 0; var NumberRange_1 = require("../../../../Core/NumberRange"); var SeriesType_1 = require("../../../../types/SeriesType"); var StackedXyCollection_1 = require("../StackedXyCollection"); /** * Defines a collection of {@link PolarStackedColumnRenderableSeries} in SciChart's High Performance Real-time * {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts} * * --- * 📚 Docs: {@link https://www.scichart.com/documentation/js/v4/2d-charts/chart-types/polar-stacked-column-renderable-series/} */ var PolarStackedColumnCollection = /** @class */ (function (_super) { __extends(PolarStackedColumnCollection, _super); /** * Creates an instance of the {@link PolarStackedColumnCollection} * @param webAssemblyContext The {@link TSciChart | SciChart WebAssembly Context} containing * native methods and access to our WebGL2 WebAssembly Drawing Engine * @param options Optional parameters of type {@link IBaseStackedCollectionOptions} to configure the series * * --- * 📚 Docs: {@link https://www.scichart.com/documentation/js/v4/2d-charts/chart-types/polar-stacked-column-renderable-series/} */ function PolarStackedColumnCollection(webAssemblyContext, options) { var _this = _super.call(this, webAssemblyContext, options) || this; _this.isPolar = true; _this.type = SeriesType_1.ESeriesType.PolarStackedColumnCollection; return _this; } PolarStackedColumnCollection.prototype.getXRange = function () { if (!this.isEnoughDataToDraw()) { return new NumberRange_1.NumberRange(); } return this.getFirstSeries().getXRange(); }; PolarStackedColumnCollection.prototype.getYRange = function (xVisibleRange, isXCategoryAxis) { var _a, _b; var range = _super.prototype.getYRange.call(this, xVisibleRange, isXCategoryAxis); // Force visible Range for stacked columns to start at their base value var zero = (_b = (_a = this.getFirstSeries()) === null || _a === void 0 ? void 0 : _a.defaultY1) !== null && _b !== void 0 ? _b : 0; return range.union(new NumberRange_1.NumberRange(zero, zero)); }; return PolarStackedColumnCollection; }(StackedXyCollection_1.StackedXyCollection)); exports.PolarStackedColumnCollection = PolarStackedColumnCollection;