UNPKG

igniteui-react-charts

Version:

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

213 lines (209 loc) 7.16 kB
import { delegateCombine, delegateRemove } from "igniteui-react-core"; import { IgrCategoryAxisBase } from "./igr-category-axis-base"; import { CategoryYAxis } from "./CategoryYAxis"; import { toPoint, fromRect } from "igniteui-react-core"; /** * Represents a IgxDataChartComponent category Y axis. */ export class IgrCategoryYAxis extends IgrCategoryAxisBase { createImplementation() { return new CategoryYAxis(); } /** * @hidden */ get i() { return this._implementation; } constructor(props) { super(props); this._actualIntervalChange = null; this._actualIntervalChange_wrapped = null; this._actualMinorIntervalChange = null; this._actualMinorIntervalChange_wrapped = null; } /** * Gets if the current axis is a vertical axis. */ get isVertical() { return this.i.dq; } /** * Gets or sets the frequency of displayed labels. * The set value is a factor that determines which labels will be hidden. For example, an interval of 2 will display every other label. */ get interval() { return this.i.qh; } set interval(v) { this.i.qh = +v; } /** * Gets the effective value for the current Interval. */ get actualInterval() { return this.i.qc; } set actualInterval(v) { this.i.qc = +v; } /** * Gets or sets the frequency of displayed minor lines. * The set value is a factor that determines how the minor lines will be displayed. */ get minorInterval() { return this.i.qi; } set minorInterval(v) { this.i.qi = +v; } /** * Gets the effective value for the current MinorInterval. */ get actualMinorInterval() { return this.i.qd; } set actualMinorInterval(v) { this.i.qd = +v; } /** * Gets or sets interval of labels on the secondary axis. */ get companionAxisInterval() { return this.i.qe; } set companionAxisInterval(v) { this.i.qe = +v; } /** * Gets or sets label angle on the secondary axis. */ get companionAxisMinorInterval() { return this.i.qf; } set companionAxisMinorInterval(v) { this.i.qf = +v; } /** * Gets or sets number of visible categories at maximum zooming level * This property is overridden by chart's WindowRectMinWidth property */ get zoomMaximumCategoryRange() { return this.i.zoomMaximumCategoryRange; } set zoomMaximumCategoryRange(v) { this.i.zoomMaximumCategoryRange = +v; } /** * Gets or sets maximum pixel span of series item that will be visible at maximum zooming level * This property ensures that series item does not get stretch above specified value. * This property is overridden by chart's WindowRectMinWidth property */ get zoomMaximumItemSpan() { return this.i.zoomMaximumItemSpan; } set zoomMaximumItemSpan(v) { this.i.zoomMaximumItemSpan = +v; } /** * Gets or sets range of categories that the chart will zoom in and fill plot area * This property is overridden by chart's WindowRect or WindowScaleHorizontal properties */ get zoomToCategoryRange() { return this.i.zoomToCategoryRange; } set zoomToCategoryRange(v) { this.i.zoomToCategoryRange = +v; } /** * Gets or sets starting category that chart will move its zoom window. Acceptable value is between 0 and number of data items * This property is overridden by chart's WindowRect or WindowScaleHorizontal properties */ get zoomToCategoryStart() { return this.i.zoomToCategoryStart; } set zoomToCategoryStart(v) { this.i.zoomToCategoryStart = +v; } /** * Gets or sets pixel span of series item that will be used to zoom chart such that the item has desired span * Chart will automatically zoom in until series item has specified pixel span. * This property is overridden by chart's WindowRect or WindowScaleHorizontal properties */ get zoomToItemSpan() { return this.i.zoomToItemSpan; } set zoomToItemSpan(v) { this.i.zoomToItemSpan = +v; } getCategoryBoundingBox(point, useInterpolation, singularWidth) { let iv = this.i.p5(toPoint(point), useInterpolation, singularWidth); return fromRect(iv); } scrollRangeIntoView(minimum, maximum) { this.i.qz(minimum, maximum); } /** * Scrolls the specified item into view. * @param item * Data item to scroll into view */ scrollIntoView(item) { this.i.qy(item); } /** * Gets window zoom scale required to zoom to specified number of categories */ getWindowZoomFromCategories(categoriesCount) { let iv = this.i.getWindowZoomFromCategories(categoriesCount); return (iv); } /** * Gets window zoom scale required to zoom to specified span of series item */ getWindowZoomFromItemSpan(pixels) { let iv = this.i.getWindowZoomFromItemSpan(pixels); return (iv); } get actualIntervalChange() { return this._actualIntervalChange; } set actualIntervalChange(ev) { if (this._actualIntervalChange_wrapped !== null) { this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualIntervalChange_wrapped); this._actualIntervalChange_wrapped = null; this._actualIntervalChange = null; } this._actualIntervalChange = ev; this._actualIntervalChange_wrapped = (o, e) => { let ext = this.actualInterval; if (this.beforeActualIntervalChange) { this.beforeActualIntervalChange(this, ext); } if (this._actualIntervalChange) { this._actualIntervalChange(this, ext); } }; this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualIntervalChange_wrapped); } get actualMinorIntervalChange() { return this._actualMinorIntervalChange; } set actualMinorIntervalChange(ev) { if (this._actualMinorIntervalChange_wrapped !== null) { this.i.propertyChanged = delegateRemove(this.i.propertyChanged, this._actualMinorIntervalChange_wrapped); this._actualMinorIntervalChange_wrapped = null; this._actualMinorIntervalChange = null; } this._actualMinorIntervalChange = ev; this._actualMinorIntervalChange_wrapped = (o, e) => { let ext = this.actualMinorInterval; if (this.beforeActualMinorIntervalChange) { this.beforeActualMinorIntervalChange(this, ext); } if (this._actualMinorIntervalChange) { this._actualMinorIntervalChange(this, ext); } }; this.i.propertyChanged = delegateCombine(this.i.propertyChanged, this._actualMinorIntervalChange_wrapped); } }