igniteui-angular-charts
Version:
Ignite UI Angular charting components for building rich data visualizations for modern web apps.
361 lines (356 loc) • 13.2 kB
JavaScript
import { __extends } from "tslib";
import { Component, Input } from '@angular/core';
import { IgxCategoryAxisBaseComponent } from "./igx-category-axis-base-component";
import { IgxNumericYAxisComponent } from "./igx-numeric-y-axis-component";
import { IgxRangeCategorySeriesComponent } from "./igx-range-category-series-component";
import { toPoint, fromPoint } from "igniteui-angular-core";
import * as i0 from "@angular/core";
/**
* Base class for ranged category series with a category X-axis and a numeric Y-axis.
*
* Instantiate HorizontalAnchoredCategorySeries
*
* ```html
* <igx-data-chart
* [dataSource]="data" >
* <igx-column-series
* #series
* [xAxis]="xAxis"
* [yAxis]="yAxis"
* valueMemberPath="value"
* >
* </igx-column-series>
* </igx-data-chart>
* ```
*
* ```ts
* let series = new IgxColumnSeriesComponent();
* series.xAxis = this.xAxis;
* series.yAxis = this.yAxis;
* series.valueMemberPath="value";
* this.chart.series.add(series);
* ```
*/
var IgxHorizontalRangeCategorySeriesComponent = /** @class */ /*@__PURE__*/ (function (_super) {
__extends(IgxHorizontalRangeCategorySeriesComponent, _super);
function IgxHorizontalRangeCategorySeriesComponent() {
return _super.call(this) || this;
}
Object.defineProperty(IgxHorizontalRangeCategorySeriesComponent.prototype, "i", {
/**
* @hidden
*/
get: function () {
return this._implementation;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxHorizontalRangeCategorySeriesComponent.prototype, "xAxis", {
/**
* Gets or sets the effective x-axis for the current CategorySeries object.
*
* Instantiate xAxis
*
* <!-- Angular -->
*
* ```html
* <igx-data-chart
* [dataSource]="data" >
* <igx-category-x-axis
* label="label"
* #xAxis
* >
* </igx-category-x-axis>
* <igx-column-series
* ...
* [xAxis]="xAxis"
* ...
* >
* </igx-column-series>
* </igx-data-chart>
* ```
*/
get: function () {
var r = this.i.xAxis;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgxCategoryAxisBaseComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.xAxis = null : this.i.xAxis = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxHorizontalRangeCategorySeriesComponent.prototype, "yAxis", {
/**
* Gets or sets the effective y-axis for the current CategorySeries object.
*
* Instantiate yAxis
*
* <!-- Angular -->
*
* ```js
* <igx-data-chart
* [dataSource]="data" >
* <igx-numeric-y-axis
* minimumValue="0"
* #yAxis>
* </igx-numeric-y-axis>
* <igx-column-series
* ...
* [yAxis]="yAxis"
* ...
* >
* </igx-column-series>
* </igx-data-chart>
* ```
*
* ```ts
* let series = new IgxColumnSeriesComponent();
* series.xAxis = this.xAxis;
* series.yAxis = this.yAxis;
* series.valueMemberPath="value";
* this.chart.series.add(series);
* ```
*/
get: function () {
var r = this.i.yAxis;
if (r == null) {
return null;
}
if (!r.externalObject) {
var e = IgxNumericYAxisComponent._createFromInternal(r);
if (e) {
e._implementation = r;
}
r.externalObject = e;
}
return r.externalObject;
},
set: function (v) {
if (v != null && this._stylingContainer && v._styling)
v._styling(this._stylingContainer, this, this);
v == null ? this.i.yAxis = null : this.i.yAxis = v.i;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxHorizontalRangeCategorySeriesComponent.prototype, "isRange", {
/**
* Checks if this series is a range series
*
* You can use the `IsRange` to get the current series is a range type series.
*
* <!-- Angular JS -->
*
* ```ts
* var r = this.series.isRange;
* ```
*/
get: function () {
return this.i.ft;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxHorizontalRangeCategorySeriesComponent.prototype, "lowMemberAsLegendLabel", {
/**
* Gets or sets the label displayed before series' Low value in the Data Legend.
*/
get: function () {
return this.i.abn;
},
set: function (v) {
this.i.abn = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxHorizontalRangeCategorySeriesComponent.prototype, "highMemberAsLegendLabel", {
/**
* Gets or sets the label displayed before series' High value in the Data Legend.
*/
get: function () {
return this.i.abj;
},
set: function (v) {
this.i.abj = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxHorizontalRangeCategorySeriesComponent.prototype, "lowMemberAsLegendUnit", {
/**
* Gets or sets the unit displayed after series' Low value in the Data Legend.
*/
get: function () {
return this.i.abp;
},
set: function (v) {
this.i.abp = v;
},
enumerable: false,
configurable: true
});
Object.defineProperty(IgxHorizontalRangeCategorySeriesComponent.prototype, "highMemberAsLegendUnit", {
/**
* Gets or sets the unit displayed after series' High value in the Data Legend.
*/
get: function () {
return this.i.abl;
},
set: function (v) {
this.i.abl = v;
},
enumerable: false,
configurable: true
});
IgxHorizontalRangeCategorySeriesComponent.prototype.findByName = function (name) {
var baseResult = _super.prototype.findByName.call(this, name);
if (baseResult) {
return baseResult;
}
if (this.xAxis && this.xAxis.name && this.xAxis.name == name) {
return this.xAxis;
}
if (this.yAxis && this.yAxis.name && this.yAxis.name == name) {
return this.yAxis;
}
return null;
};
IgxHorizontalRangeCategorySeriesComponent.prototype._styling = function (container, component, parent) {
_super.prototype._styling.call(this, container, component, parent);
this._inStyling = true;
if (this.xAxis && this.xAxis._styling) {
this.xAxis._styling(container, component, this);
}
if (this.yAxis && this.yAxis._styling) {
this.yAxis._styling(container, component, this);
}
this._inStyling = false;
};
/**
* Returns the offset value for this series if grouped on a category axis.
*
* You can use the `GetOffsetValue` to get the offset value for this series if grouped on a category axis.
*
* <!-- Angular JS -->
*
* var g = series.getOffsetValue();
*
* <!-- Ignite JS -->
*
* N/A
*/
IgxHorizontalRangeCategorySeriesComponent.prototype.getOffsetValue = function () {
var iv = this.i.getOffsetValue();
return (iv);
};
/**
* Returns the width of the category grouping this series is in.
*
* You can use the `GetCategoryWidth` to get the width of the category grouping a series is in.
*
* <!-- Angular JS -->
*
* var x = this.financialSeries.CanUseAsXAxis(this.xAxis);
*
* <!-- Ignite JS -->
*
* N/A
*/
IgxHorizontalRangeCategorySeriesComponent.prototype.getCategoryWidth = function () {
var iv = this.i.getCategoryWidth();
return (iv);
};
IgxHorizontalRangeCategorySeriesComponent.prototype.getNextOrExactIndex = function (world, skipUnknowns) {
var iv = this.i.j7(toPoint(world), skipUnknowns);
return (iv);
};
IgxHorizontalRangeCategorySeriesComponent.prototype.getPreviousOrExactIndex = function (world, skipUnknowns) {
var iv = this.i.j9(toPoint(world), skipUnknowns);
return (iv);
};
IgxHorizontalRangeCategorySeriesComponent.prototype.getSeriesValue = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.i4(toPoint(world), useInterpolation, skipUnknowns);
return (iv);
};
IgxHorizontalRangeCategorySeriesComponent.prototype.getSeriesLowValue = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.i2(toPoint(world), useInterpolation, skipUnknowns);
return (iv);
};
IgxHorizontalRangeCategorySeriesComponent.prototype.getSeriesHighValue = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.i0(toPoint(world), useInterpolation, skipUnknowns);
return (iv);
};
IgxHorizontalRangeCategorySeriesComponent.prototype.getSeriesHighValuePosition = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.v7(toPoint(world), useInterpolation, skipUnknowns);
return fromPoint(iv);
};
IgxHorizontalRangeCategorySeriesComponent.prototype.getSeriesLowValuePosition = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.v9(toPoint(world), useInterpolation, skipUnknowns);
return fromPoint(iv);
};
IgxHorizontalRangeCategorySeriesComponent.prototype.getSeriesValuePosition = function (world, useInterpolation, skipUnknowns) {
var iv = this.i.wb(toPoint(world), useInterpolation, skipUnknowns);
return fromPoint(iv);
};
/**
* Determine if object can be used as YAxis
* @param axis * The object to check
*
* You can use the `CanUseAsYAxis` method to determine if object can be used as YAxis
*/
IgxHorizontalRangeCategorySeriesComponent.prototype.canUseAsYAxis = function (axis) {
var iv = this.i.abi(axis);
return (iv);
};
/**
* Determine if object can be used as XAxis
* @param axis * The object to check
*
* You can use the `CanUseAsXAxis` method to determine if object can be used as XAxis
*
* <!-- Angular JS -->
*
* var x = this.financialSeries.CanUseAsXAxis(this.xAxis);
*/
IgxHorizontalRangeCategorySeriesComponent.prototype.canUseAsXAxis = function (axis) {
var iv = this.i.abh(axis);
return (iv);
};
IgxHorizontalRangeCategorySeriesComponent.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxHorizontalRangeCategorySeriesComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
IgxHorizontalRangeCategorySeriesComponent.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "12.0.0", version: "12.2.17", type: IgxHorizontalRangeCategorySeriesComponent, selector: "ng-component", inputs: { xAxis: "xAxis", yAxis: "yAxis", lowMemberAsLegendLabel: "lowMemberAsLegendLabel", highMemberAsLegendLabel: "highMemberAsLegendLabel", lowMemberAsLegendUnit: "lowMemberAsLegendUnit", highMemberAsLegendUnit: "highMemberAsLegendUnit" }, usesInheritance: true, ngImport: i0, template: "", isInline: true });
return IgxHorizontalRangeCategorySeriesComponent;
}(IgxRangeCategorySeriesComponent));
export { IgxHorizontalRangeCategorySeriesComponent };
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.17", ngImport: i0, type: IgxHorizontalRangeCategorySeriesComponent, decorators: [{
type: Component,
args: [{
template: "",
}]
}], ctorParameters: function () { return []; }, propDecorators: { xAxis: [{
type: Input
}], yAxis: [{
type: Input
}], lowMemberAsLegendLabel: [{
type: Input
}], highMemberAsLegendLabel: [{
type: Input
}], lowMemberAsLegendUnit: [{
type: Input
}], highMemberAsLegendUnit: [{
type: Input
}] } });