UNPKG

scichart

Version:

Fast WebGL JavaScript Charting Library and Framework

53 lines (52 loc) 2.64 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.CategoryAxis = void 0; var AxisType_1 = require("../../../types/AxisType"); var CategoryAxisBase_1 = require("./CategoryAxisBase"); var DateLabelProvider_1 = require("./LabelProvider/DateLabelProvider"); var TextLabelProvider_1 = require("./LabelProvider/TextLabelProvider"); /** * @summary A 2D Chart Category Axis type * @description A category axis uses the X-index not the X-value to measure data-points on the XAxis. * For example this can be used in stock chart applications to ensure weekend or overnight gaps are collapsed * and each data-point is spaced equidistantly * @remarks * Set a {@link CategoryAxis} on the {@link SciChartSurface.xAxes} property. This axis type is not valid for YAxis * * --- * 📚 Docs: {@link https://www.scichart.com/documentation/js/v4/2d-charts/axis-api/axis-types/category-axis/} */ var CategoryAxis = /** @class */ (function (_super) { __extends(CategoryAxis, _super); function CategoryAxis(webAssemblyContext, options) { var _this = _super.call(this, webAssemblyContext, options) || this; _this.type = AxisType_1.EAxisType.CategoryAxis; if (options === null || options === void 0 ? void 0 : options.labelProvider) { _this.labelProvider = options === null || options === void 0 ? void 0 : options.labelProvider; } else if (options === null || options === void 0 ? void 0 : options.labels) { _this.labelProvider = new TextLabelProvider_1.TextLabelProvider(options); } else { _this.labelProvider = new DateLabelProvider_1.DateLabelProvider(options); } return _this; } return CategoryAxis; }(CategoryAxisBase_1.CategoryAxisBase)); exports.CategoryAxis = CategoryAxis;