Range Area Chart
The Ignite UI for React range area chart belongs to a group of range charts and is rendered using two lines with the area between the lines filled in. This type of series emphasizes the amount of change between low values and high values in the same data point over a period of time or compares multiple items. Range values are represented on the y-axis and categories are displayed on the x-axis. The IgrRangeAreaSeries is identical to the IgrRangeColumnSeries in all aspects except that the ranges are represented as filled area rather than a set of vertical columns.
Demo
Required Axes
The React data chart component provides various types of axes but only the following types of axes can be used with IgrRangeAreaSeries:
Required Data
The IgrRangeAreaSeries has the following data requirements:
- The data source must be an array or a list of data items.
- The data source must contain at least one data item otherwise the chart will not render the
IgrRangeAreaSeries. - All data items must contain at least one label data column (string or date time) which should be mapped to the
Labelproperty of the category axis (e.g.IgrCategoryXAxis). - All data items must contain at least two numeric data column which should be mapped using the
HighMemberPathandLowMemberPathproperties of theIgrRangeAreaSeries.
You can use the SampleRangeData as data source which meets above data requirements.
public dataSource: any[] = SampleRangeData.create();
Required Modules
Creation of the IgrRangeAreaSeries requires the following modules:
import { IgrNumericYAxis } from 'igniteui-react-charts';
import { IgrCategoryXAxis } from 'igniteui-react-charts';
import { IgrRangeAreaSeries } from 'igniteui-react-charts';
import { IgrDataChart } from 'igniteui-react-charts';
import { IgrDataChartCoreModule } from 'igniteui-react-charts';
import { IgrDataChartCategoryModule } from 'igniteui-react-charts';
// registering data chart's modules:
IgrDataChartCoreModule.register();
IgrDataChartCategoryModule.register();
Code Example
This code demonstrates how to create an instance of the Ignite UI for React data chart with IgrRangeAreaSeries and bind it to a data source.
<IgrDataChart
dataSource={this.state.dataSource}
width="700px"
height="500px">
{/* axes */}
<IgrCategoryXAxis name="xAxis" label="Year" />
<IgrNumericYAxis name="yAxis" />
{/* series: */}
<IgrRangeAreaSeries
name="series1"
xAxisName="xAxis"
yAxisName="yAxis"
highMemberPath="High"
lowMemberPath="Low" />
</IgrDataChart>
const series1 = new IgrRangeAreaSeries({ name: "series1" });
series1.highMemberPath = "High";
series1.lowMemberPath = "Low";
series1.xAxisName = "xAxis";
series1.yAxisName = "yAxis";
const xAxis = new IgrNumericXAxis({ name: "xAxis" });
const yAxis = new IgrCategoryYAxis({ name: "yAxis" });
yAxis.label = "Year";
this.chart = new IgrDataChart({ name: "chart" });
this.chart.dataSource = SampleRangeData.create();
this.chart.axes.add(yAxis);
this.chart.axes.add(xAxis);
this.chart.series.add(series1);