UNPKG

scichart

Version:

Fast WebGL JavaScript Charting Library and Framework

75 lines (74 loc) 3.91 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.FastMountainRenderableSeries = void 0; var SeriesType_1 = require("../../../types/SeriesType"); var BaseMountainRenderableSeries_1 = require("./BaseMountainRenderableSeries"); var DataLabelProvider_1 = require("./DataLabels/DataLabelProvider"); /** * Defines a mountain/area series or JavaScript mountain chart type in the SciChart's High Performance Real-time * {@link https://www.scichart.com/javascript-chart-features | JavaScript Charts} * @remarks * To add a mountain series to a {@link SciChartSurface} you need to declare both the {@link FastMountainRenderableSeries | RenderableSeries} * and a {@link XyDataSeries | DataSeries}. Simplified code sample below: * * ```ts * const sciChartSurface: SciChartSurface; * const wasmContext: TSciChart; * // Create and fill the dataseries * const dataSeries = new XyDataSeries(wasmContext); * dataSeries.append(1,2); * dataSeries.append(1,2); * // Create the renderableSeries * const mountainSeries = new FastMountainRenderableSeries(wasmContext); * mountainSeries.dataSeries = dataSeries; * // append to the SciChartSurface * sciChartSurface.renderableSeries.add(mountainSeries); * ``` * * --- * 📚 Docs: {@link https://www.scichart.com/documentation/js/v4/2d-charts/chart-types/fast-mountain-area-renderable-series/} */ var FastMountainRenderableSeries = /** @class */ (function (_super) { __extends(FastMountainRenderableSeries, _super); /** * Creates an instance of the {@link FastMountainRenderableSeries} * @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 IMountainRenderableSeriesOptions} applied when constructing the series type * * --- * 📚 Docs: {@link https://www.scichart.com/documentation/js/v4/2d-charts/chart-types/fast-mountain-area-renderable-series/} */ function FastMountainRenderableSeries(webAssemblyContext, options) { var _this = this; var _a, _b; _this = _super.call(this, webAssemblyContext, options) || this; _this.type = SeriesType_1.ESeriesType.MountainSeries; if (!_this.dataLabelProviderProperty) { _this.dataLabelProviderProperty = new DataLabelProvider_1.DataLabelProvider(options === null || options === void 0 ? void 0 : options.dataLabels); _this.dataLabelProviderProperty.onAttach(_this.webAssemblyContext, _this); } // Must be called here for the series type to be available if ((_a = _this.paletteProvider) === null || _a === void 0 ? void 0 : _a.onAttached) { (_b = _this.paletteProvider) === null || _b === void 0 ? void 0 : _b.onAttached(_this); } return _this; } return FastMountainRenderableSeries; }(BaseMountainRenderableSeries_1.BaseMountainRenderableSeries)); exports.FastMountainRenderableSeries = FastMountainRenderableSeries;