UNPKG

igniteui-react-charts

Version:

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

537 lines (532 loc) 18.6 kB
import { __extends } from "tslib"; import { TrendLineType_$type } from "igniteui-react-core"; import { CategorySeriesMarkerCollisionAvoidance_$type } from "./CategorySeriesMarkerCollisionAvoidance"; import { ConsolidatedItemHitTestBehavior_$type } from "./ConsolidatedItemHitTestBehavior"; import { IgrCategorySeries } from "./igr-category-series"; import { ensureEnum, brushToString, stringToBrush, toDoubleCollection, fromDoubleCollection, toPoint, fromPoint } from "igniteui-react-core"; /** * Represents the base class for all IgxDataChartComponent anchored category/value series. * * The `AnchoredCategorySeries` represents the base class for all IgxDataChartComponent anchored category/value series. * * ```ts * <IgrDataChart > * * * <IgrCategoryXAxis name="xAxisYears" * interval={12} labelLocation="OutsideBottom" * label="Year" overlap={1} gap={0.4} /> * * <IgrCategoryXAxis name="xAxisMonths" * interval={1} labelLocation="OutsideBottom" * label="Month" overlap={1} gap={0.4}/> * * <IgrNumericYAxis name="yAxisLeft" * title="Expanse | Revenue" * minimumValue={-900} labelLocation="OutsideLeft" * maximumValue={900} * interval={300} /> * * <IgrNumericYAxis name="yAxisRight" * title="Profit (%)" * minimumValue={0} labelLocation="OutsideRight" * maximumValue={100} /> * * * <IgrLineSeries name="series1" * valueMemberPath="Revenue" * xAxisName="xAxisMonths" * yAxisName="yAxisLeft" /> * </IgrDataChart> * ``` */ var IgrAnchoredCategorySeries = /** @class */ /*@__PURE__*/ (function (_super) { __extends(IgrAnchoredCategorySeries, _super); function IgrAnchoredCategorySeries(props) { return _super.call(this, props) || this; } Object.defineProperty(IgrAnchoredCategorySeries.prototype, "i", { /** * @hidden */ get: function () { return this._implementation; }, enumerable: false, configurable: true }); Object.defineProperty(IgrAnchoredCategorySeries.prototype, "valueMemberPath", { /** * Gets or sets the value mapping property for the current series object. * * The `ValueMemberPath` property is used for the value mapping property of the current series object. * * ```ts * <IgrDataChart > * * * <IgrCategoryXAxis name="xAxisYears" * interval={12} labelLocation="OutsideBottom" * label="Year" overlap={1} gap={0.4} /> * * <IgrCategoryXAxis name="xAxisMonths" * interval={1} labelLocation="OutsideBottom" * label="Month" overlap={1} gap={0.4}/> * * <IgrNumericYAxis name="yAxisLeft" * title="Expanse | Revenue" * minimumValue={-900} labelLocation="OutsideLeft" * maximumValue={900} * interval={300} /> * * <IgrNumericYAxis name="yAxisRight" * title="Profit (%)" * minimumValue={0} labelLocation="OutsideRight" * maximumValue={100} /> * * * <IgrLineSeries name="series1" * valueMemberPath="Revenue" * xAxisName="xAxisMonths" * yAxisName="yAxisLeft" /> * </IgrDataChart> * ``` */ get: function () { return this.i.abu; }, set: function (v) { this.i.abu = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrAnchoredCategorySeries.prototype, "highlightedValueMemberPath", { /** * Gets or sets the value mapping property for the current series object. */ get: function () { return this.i.abm; }, set: function (v) { this.i.abm = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrAnchoredCategorySeries.prototype, "valueMemberAsLegendLabel", { /** * Gets or sets the label displayed before series value in the Data Legend. */ get: function () { return this.i.abq; }, set: function (v) { this.i.abq = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrAnchoredCategorySeries.prototype, "valueMemberAsLegendUnit", { /** * Gets or sets the unit displayed after series value in the Data Legend. */ get: function () { return this.i.abs; }, set: function (v) { this.i.abs = v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrAnchoredCategorySeries.prototype, "trendLineType", { /** * Gets or sets the trend type for the current series object. * * The `TrendLineType` property is used for the current series object's trend type.' * * ```ts * <IgrDataChart > * * * <IgrCategoryXAxis name="xAxisYears" * interval={12} labelLocation="OutsideBottom" * label="Year" overlap={1} gap={0.4} /> * * <IgrCategoryXAxis name="xAxisMonths" * interval={1} labelLocation="OutsideBottom" * label="Month" overlap={1} gap={0.4}/> * * <IgrNumericYAxis name="yAxisLeft" * title="Expanse | Revenue" * minimumValue={-900} labelLocation="OutsideLeft" * maximumValue={900} * interval={300} /> * * <IgrNumericYAxis name="yAxisRight" * title="Profit (%)" * minimumValue={0} labelLocation="OutsideRight" * maximumValue={100} /> * * * <IgrLineSeries name="series1" * valueMemberPath="Revenue" * xAxisName="xAxisMonths" * yAxisName="yAxisLeft" * trendLineType="SimpleAverage" /> * </IgrDataChart> * ``` * * ```ts * series.trendLineType= "CubicFit"; * ``` */ get: function () { return this.i.trendLineType; }, set: function (v) { this.i.trendLineType = ensureEnum(TrendLineType_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrAnchoredCategorySeries.prototype, "trendLineBrush", { /** * Gets or sets the brush to use to draw the trend line. * * The `TrendLineBrush` property is used to brush the trend line. * * ```ts * <IgrDataChart > * * * <IgrCategoryXAxis name="xAxisYears" * interval={12} labelLocation="OutsideBottom" * label="Year" overlap={1} gap={0.4} /> * * <IgrCategoryXAxis name="xAxisMonths" * interval={1} labelLocation="OutsideBottom" * label="Month" overlap={1} gap={0.4}/> * * <IgrNumericYAxis name="yAxisLeft" * title="Expanse | Revenue" * minimumValue={-900} labelLocation="OutsideLeft" * maximumValue={900} * interval={300} /> * * <IgrNumericYAxis name="yAxisRight" * title="Profit (%)" * minimumValue={0} labelLocation="OutsideRight" * maximumValue={100} /> * * * <IgrLineSeries name="series1" * valueMemberPath="Revenue" * xAxisName="xAxisMonths" * yAxisName="yAxisLeft" * trendLineBrush="Gray" /> * </IgrDataChart> * ``` * * ```ts * series.trendLineBrush="red"; * ``` */ get: function () { return brushToString(this.i.trendLineBrush); }, set: function (v) { this.i.trendLineBrush = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrAnchoredCategorySeries.prototype, "actualTrendLineBrush", { /** * Gets the effective TrendLineBrush for this series. * * The `ActualTrendLineBrush` property is used to gets the effective `TrendLineBrush` for this series. */ get: function () { return brushToString(this.i.ach); }, set: function (v) { this.i.ach = stringToBrush(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrAnchoredCategorySeries.prototype, "trendLineThickness", { /** * Gets or sets the thickness of the current series object's trend line. * * The `TrendLineThickness` property is used for thickness of the current series object's trend line. * * ```ts * <IgrDataChart > * * * <IgrCategoryXAxis name="xAxisYears" * interval={12} labelLocation="OutsideBottom" * label="Year" overlap={1} gap={0.4} /> * * <IgrCategoryXAxis name="xAxisMonths" * interval={1} labelLocation="OutsideBottom" * label="Month" overlap={1} gap={0.4}/> * * <IgrNumericYAxis name="yAxisLeft" * title="Expanse | Revenue" * minimumValue={-900} labelLocation="OutsideLeft" * maximumValue={900} * interval={300} /> * * <IgrNumericYAxis name="yAxisRight" * title="Profit (%)" * minimumValue={0} labelLocation="OutsideRight" * maximumValue={100} /> * * * <IgrLineSeries name="series1" * valueMemberPath="Revenue" * xAxisName="xAxisMonths" * yAxisName="yAxisLeft" * trendLineThickness ="2" /> * </IgrDataChart> * ``` * * ```ts * series.trendLineThickness= 2; * ``` */ get: function () { return this.i.trendLineThickness; }, set: function (v) { this.i.trendLineThickness = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrAnchoredCategorySeries.prototype, "trendLineDashArray", { /** * Gets or sets a collection of double values that indicate the pattern of dashes and gaps that * is used to draw the trend line for the current series object. */ get: function () { return fromDoubleCollection(this.i.aci); }, set: function (v) { this.i.aci = toDoubleCollection(v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrAnchoredCategorySeries.prototype, "trendLinePeriod", { /** * Gets or sets the trend line period for the current series. * The typical, and initial, value for trend line period is 7. * * The `TrendLinePeriod` property is used for trend line period of the current series. * * ```ts * <IgrDataChart > * * * <IgrCategoryXAxis name="xAxisYears" * interval={12} labelLocation="OutsideBottom" * label="Year" overlap={1} gap={0.4} /> * * <IgrCategoryXAxis name="xAxisMonths" * interval={1} labelLocation="OutsideBottom" * label="Month" overlap={1} gap={0.4}/> * * <IgrNumericYAxis name="yAxisLeft" * title="Expanse | Revenue" * minimumValue={-900} labelLocation="OutsideLeft" * maximumValue={900} * interval={300} /> * * <IgrNumericYAxis name="yAxisRight" * title="Profit (%)" * minimumValue={0} labelLocation="OutsideRight" * maximumValue={100} /> * * * <IgrLineSeries name="series1" * valueMemberPath="Revenue" * xAxisName="xAxisMonths" * yAxisName="yAxisLeft" * trendLinePeriod ="2" /> * </IgrDataChart> * ``` * * ```ts * series.trendLinePeriod= 7; * ``` */ get: function () { return this.i.trendLinePeriod; }, set: function (v) { this.i.trendLinePeriod = +v; }, enumerable: false, configurable: true }); Object.defineProperty(IgrAnchoredCategorySeries.prototype, "markerCollisionAvoidance", { /** * The desired behavior for markers in this series which are placed too close together for the current view, resulting in a collision. * * The `MarkerCollisionAvoidance` property controls the technique the chart uses to avoid overlapping markers. * * ```ts * <IgrDataChart > * * * <IgrCategoryXAxis name="xAxisYears" * interval={12} labelLocation="OutsideBottom" * label="Year" overlap={1} gap={0.4} /> * * <IgrCategoryXAxis name="xAxisMonths" * interval={1} labelLocation="OutsideBottom" * label="Month" overlap={1} gap={0.4}/> * * <IgrNumericYAxis name="yAxisLeft" * title="Expanse | Revenue" * minimumValue={-900} labelLocation="OutsideLeft" * maximumValue={900} * interval={300} /> * * <IgrNumericYAxis name="yAxisRight" * title="Profit (%)" * minimumValue={0} labelLocation="OutsideRight" * maximumValue={100} /> * * * <IgrLineSeries name="series1" * valueMemberPath="Revenue" * xAxisName="xAxisMonths" * yAxisName="yAxisLeft" * markerCollisionAvoidance="fade" /> * </IgrDataChart> * ``` */ get: function () { return this.i.aa4; }, set: function (v) { this.i.aa4 = ensureEnum(CategorySeriesMarkerCollisionAvoidance_$type, v); }, enumerable: false, configurable: true }); Object.defineProperty(IgrAnchoredCategorySeries.prototype, "consolidatedItemHitTestBehavior", { /** * Determines the item returned in hit-testing when the pointer is over an object which represents several consolidated items. * * The `ConsolidatedItemHitTestBehavior` property is used to determines returned item in hit-testing when the pointer is over an object which represents several consolidated items. * * ```ts * <IgrDataChart > * * * <IgrCategoryXAxis name="xAxisYears" * interval={12} labelLocation="OutsideBottom" * label="Year" overlap={1} gap={0.4} /> * * <IgrCategoryXAxis name="xAxisMonths" * interval={1} labelLocation="OutsideBottom" * label="Month" overlap={1} gap={0.4}/> * * <IgrNumericYAxis name="yAxisLeft" * title="Expanse | Revenue" * minimumValue={-900} labelLocation="OutsideLeft" * maximumValue={900} * interval={300} /> * * <IgrNumericYAxis name="yAxisRight" * title="Profit (%)" * minimumValue={0} labelLocation="OutsideRight" * maximumValue={100} /> * * * <IgrLineSeries name="series1" * valueMemberPath="Revenue" * xAxisName="xAxisMonths" * yAxisName="yAxisLeft" * consolidatedItemHitTestBehavior="Basic" /> * </IgrDataChart> * ``` */ get: function () { return this.i.aa5; }, set: function (v) { this.i.aa5 = ensureEnum(ConsolidatedItemHitTestBehavior_$type, v); }, enumerable: false, configurable: true }); IgrAnchoredCategorySeries.prototype.getItemValue = function (item, memberPathName) { var iv = this.i.kr(item, memberPathName); return (iv); }; /** * Gets the value of a requested member path from the series. * @param memberPathName * The property name of a valid member path for the series */ IgrAnchoredCategorySeries.prototype.getMemberPathValue = function (memberPathName) { var iv = this.i.mf(memberPathName); return (iv); }; /** * Scrolls the series to display the item for the specified data item. * The series is scrolled by the minimum amount required to place the specified data item within * the central 80% of the visible axis. * @param item * The data item (item) to scroll to. * * The `ScrollIntoView` method is used to notifies the target axis or series that it should scroll the requested data item into view. * * ```ts * this.series.scrollIntoView(dataItem); * ``` */ IgrAnchoredCategorySeries.prototype.scrollIntoView = function (item) { var iv = this.i.ge(item); return (iv); }; /** * Gets the item that is the best match for the specified world coordinates. * @param world * The world coordinates to use. * * The `getItem` method is used to gets the item that is the best match for the specified world coordinates. * * ```ts * let item: number = this.series.getItem({x:.5,y:.5}); * ``` */ IgrAnchoredCategorySeries.prototype.getItem = function (world) { var iv = this.i.ko(toPoint(world)); return (iv); }; /** * Gets a numeric value from the numeric axis associated with this series that matches the desired * value mode. * @param mode * The type of value desired from the series numeric axis. */ IgrAnchoredCategorySeries.prototype.getSeriesValueType = function (mode) { var iv = this.i.aq((mode == null ? null : mode)); return (iv); }; IgrAnchoredCategorySeries.prototype.getSeriesValueTypePosition = function (mode) { var iv = this.i.wk((mode == null ? null : mode)); return fromPoint(iv); }; IgrAnchoredCategorySeries.prototype.getSeriesValueTypePositionFromValue = function (values) { var iv = this.i.wl(values); return fromPoint(iv); }; return IgrAnchoredCategorySeries; }(IgrCategorySeries)); export { IgrAnchoredCategorySeries };