UNPKG

igniteui-react-charts

Version:

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

127 lines (126 loc) 3.84 kB
import { UnknownValuePlotting_$type } from "igniteui-react-core"; import { IgrHorizontalAnchoredCategorySeries } from "./igr-horizontal-anchored-category-series"; import { AreaSeries } from "./AreaSeries"; import { ensureEnum } from "igniteui-react-core"; /** * Represents a IgxDataChartComponent area series. * Displays trend over time or ordered categories. * Useful when there are many data points and the order is important. * * The `AreaSeries` class represents a IgxDataChartComponent area series.Displays trend over time or ordered categories. * * Useful when there are many data points and the order is important. * * ```ts * <IgrDataChart * width="100%" * height="100%" * chartTitle="COMPANY FINANCIAL PROJECTIONS" * dataSource={this.data}> * * * <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} /> * * * <IgrAreaSeries name="series1" * valueMemberPath="Revenue" * xAxisName="xAxisMonths" * yAxisName="yAxisLeft" /> * </IgrDataChart> * ``` */ export class IgrAreaSeries extends IgrHorizontalAnchoredCategorySeries { createImplementation() { return new AreaSeries(); } /** * @hidden */ get i() { return this._implementation; } constructor(props) { super(props); } /** * Gets whether the current series shows an area or line shape. * * The `IsAreaOrLine` is used to check if the current series shows an area or line shape. */ get isAreaOrLine() { return this.i.ex; } /** * Gets whether the current series shows an area shape. */ get isArea() { return this.i.ew; } /** * Determines how unknown values will be plotted on the chart. * Null and Double.NaN are two examples of unknown values. * * The `unknownValuePlotting` property is used to determines how unknown values will be plotted on the chart. * * Null and Double.NaN are two examples of unknown values. * * ```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} /> * * * <IgrAreaSeries name="series1" * valueMemberPath="Revenue" * xAxisName="xAxisMonths" * yAxisName="yAxisLeft" * unknownValuePlotting="DontPlot" /> * </IgrDataChart> * ``` * * ```ts * series.unknownValuePlotting = UnknownValuePlotting.LinearInterpolate; * ``` */ get unknownValuePlotting() { return this.i.unknownValuePlotting; } set unknownValuePlotting(v) { this.i.unknownValuePlotting = ensureEnum(UnknownValuePlotting_$type, v); } }