UNPKG

igniteui-react-charts

Version:

Ignite UI React charting components for building rich data visualizations using TypeScript APIs.

262 lines (254 loc) 7.78 kB
import { IgrNumericXAxis } from "./igr-numeric-x-axis"; import { IgrCategoryAxisBase } from "./igr-category-axis-base"; import { IgrRangeCategorySeries } from "./igr-range-category-series"; import { toPoint, fromPoint } from "igniteui-react-core"; /** * Base class for ranged category series with a numeric X-axis and a category Y-axis. */ export class IgrVerticalRangeCategorySeries extends IgrRangeCategorySeries { /** * @hidden */ get i() { return this._implementation; } constructor(props) { super(props); this._xAxisName = null; this._yAxisName = null; } /** * Gets or sets the effective x-axis for the current CategorySeries object. */ get xAxis() { const r = this.i.xAxis; if (r == null) { return null; } if (!r.externalObject) { let e = IgrNumericXAxis._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set xAxis(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; } /** * Gets or sets the name to use to resolve xAxis from markup. */ get xAxisName() { return this._xAxisName; } set xAxisName(v) { this._xAxisName = v; } /** * Gets or sets the effective y-axis for the current CategorySeries object. */ get yAxis() { const r = this.i.yAxis; if (r == null) { return null; } if (!r.externalObject) { let e = IgrCategoryAxisBase._createFromInternal(r); if (e) { e._implementation = r; } r.externalObject = e; } return r.externalObject; } set yAxis(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; } /** * Gets or sets the name to use to resolve yAxis from markup. */ get yAxisName() { return this._yAxisName; } set yAxisName(v) { this._yAxisName = v; } /** * Gets whether or not the current series is vertical series */ get isVertical() { return this.i.isVertical; } /** * Checks if this series is a range series */ get isRange() { return this.i.fy; } /** * Gets or sets the label displayed before series' Low value in the Data Legend. */ get lowMemberAsLegendLabel() { return this.i.acj; } set lowMemberAsLegendLabel(v) { this.i.acj = v; } /** * Gets or sets the label displayed before series' High value in the Data Legend. */ get highMemberAsLegendLabel() { return this.i.acf; } set highMemberAsLegendLabel(v) { this.i.acf = v; } /** * Gets or sets the unit displayed after series' Low value in the Data Legend. */ get lowMemberAsLegendUnit() { return this.i.acl; } set lowMemberAsLegendUnit(v) { this.i.acl = v; } /** * Gets or sets the unit displayed after series' High value in the Data Legend. */ get highMemberAsLegendUnit() { return this.i.ach; } set highMemberAsLegendUnit(v) { this.i.ach = v; } bindAxes(axes) { super.bindAxes(axes); for (let i = 0; i < axes.length; i++) { if (this.xAxisName && this.xAxisName.length > 0 && axes[i].name == this.xAxisName) { this.xAxis = axes[i]; } } for (let i = 0; i < axes.length; i++) { if (this.yAxisName && this.yAxisName.length > 0 && axes[i].name == this.yAxisName) { this.yAxis = axes[i]; } } } findByName(name) { var baseResult = super.findByName(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; } _styling(container, component, parent) { super._styling(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. */ getOffsetValue() { let iv = this.i.getOffsetValue(); return (iv); } /** * Returns the width of the category grouping this series is in. */ getCategoryWidth() { let iv = this.i.getCategoryWidth(); return (iv); } /** * Gets the precise item index using the vertical (Y-based) category axis. * The base implementation uses the horizontal interaction manager which reads world.X; * vertical series must read world.Y instead. */ getExactItemIndex(world) { let iv = this.i.i0(toPoint(world)); return (iv); } /** * Gets the index of the item that resides at the provided world coordinates (vertical orientation). */ getItemIndex(world) { let iv = this.i.ke(toPoint(world)); return (iv); } /** * Gets the item that is the best match for the specified world coordinates (vertical orientation). */ getItem(world) { let iv = this.i.ky(toPoint(world)); return (iv); } getNextOrExactIndex(world, skipUnknowns) { let iv = this.i.kj(toPoint(world), skipUnknowns); return (iv); } getPreviousOrExactIndex(world, skipUnknowns) { let iv = this.i.kl(toPoint(world), skipUnknowns); return (iv); } getSeriesValue(world, useInterpolation, skipUnknowns) { let iv = this.i.jf(toPoint(world), useInterpolation, skipUnknowns); return (iv); } getSeriesLowValue(world, useInterpolation, skipUnknowns) { let iv = this.i.jd(toPoint(world), useInterpolation, skipUnknowns); return (iv); } getSeriesHighValue(world, useInterpolation, skipUnknowns) { let iv = this.i.jb(toPoint(world), useInterpolation, skipUnknowns); return (iv); } getSeriesHighValuePosition(world, useInterpolation, skipUnknowns) { let iv = this.i.wu(toPoint(world), useInterpolation, skipUnknowns); return fromPoint(iv); } getSeriesLowValuePosition(world, useInterpolation, skipUnknowns) { let iv = this.i.ww(toPoint(world), useInterpolation, skipUnknowns); return fromPoint(iv); } getSeriesValuePosition(world, useInterpolation, skipUnknowns) { let iv = this.i.wy(toPoint(world), useInterpolation, skipUnknowns); return fromPoint(iv); } /** * Determine if object can be used as YAxis * @param axis * The object to check */ canUseAsYAxis(axis) { let iv = this.i.ace(axis); return (iv); } /** * Determine if object can be used as XAxis * @param axis * The object to check */ canUseAsXAxis(axis) { let iv = this.i.acd(axis); return (iv); } }