ag-charts-community
Version:
Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue
61 lines • 2.17 kB
JavaScript
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 (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
import { BandScale } from "../../scale/bandScale";
import { ChartAxis } from "../chartAxis";
var CategoryAxis = /** @class */ (function (_super) {
__extends(CategoryAxis, _super);
function CategoryAxis() {
var _this = _super.call(this, new BandScale()) || this;
_this.scale.paddingInner = 0.2;
_this.scale.paddingOuter = 0.3;
return _this;
}
Object.defineProperty(CategoryAxis.prototype, "paddingInner", {
get: function () {
return this.scale.paddingInner;
},
set: function (value) {
this.scale.paddingInner = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(CategoryAxis.prototype, "paddingOuter", {
get: function () {
return this.scale.paddingOuter;
},
set: function (value) {
this.scale.paddingOuter = value;
},
enumerable: true,
configurable: true
});
Object.defineProperty(CategoryAxis.prototype, "domain", {
get: function () {
return this.scale.domain.slice();
},
set: function (values) {
// Prevent duplicate categories.
this.scale.domain = values
.filter(function (s, i, arr) { return arr.indexOf(s) === i; });
},
enumerable: true,
configurable: true
});
CategoryAxis.className = 'CategoryAxis';
CategoryAxis.type = 'category';
return CategoryAxis;
}(ChartAxis));
export { CategoryAxis };
//# sourceMappingURL=categoryAxis.js.map