Range Area Chart

The Ignite UI for Web Components 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 IgcRangeAreaSeriesComponent is identical to the IgcRangeColumnSeriesComponent in all aspects except that the ranges are represented as filled area rather than a set of vertical columns.

Demo

Required Axes

The Web Components data chart component provides various types of axes but only the following types of axes can be used with IgcRangeAreaSeriesComponent:

Required Data

The IgcRangeAreaSeriesComponent 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 IgcRangeAreaSeriesComponent.
  • All data items must contain at least one label data column (string or date time) which should be mapped to the Label property of the category axis (e.g. IgcCategoryXAxisComponent).
  • All data items must contain at least two numeric data column which should be mapped using the HighMemberPath and LowMemberPath properties of the IgcRangeAreaSeriesComponent.

You can use the SampleRangeData as data source which meets above data requirements.

public dataSource: any[] = SampleRangeData.create();

Required Modules

Creation of the IgcRangeAreaSeriesComponent requires the following modules:

import { IgcDataChartComponent } from 'igniteui-webcomponents-charts';
import { IgcDataChartCoreModule } from 'igniteui-webcomponents-charts';
import { IgcDataChartCategoryCoreModule } from 'igniteui-webcomponents-charts';
import { IgcDataChartCategoryModule } from 'igniteui-webcomponents-charts';
import { IgcDataChartInteractivityModule } from 'igniteui-webcomponents-charts';
import { IgcRangeAreaSeriesModule } from 'igniteui-webcomponents-charts';
import { ModuleManager } from 'igniteui-webcomponents-core';

ModuleManager.register(
    IgcDataChartCoreModule,
    IgcDataChartCategoryCoreModule,
    IgcDataChartCategoryModule,
    IgcDataChartInteractivityModule,
    IgcRangeAreaSeriesModule
);

Code Example

This code demonstrates how to create an instance of the Ignite UI for Web Components data chart with IgcRangeAreaSeriesComponent and bind it to a data source.

 <igc-data-chart id="chart"
    width="700px"
    height="500px">
    <igc-category-x-axis id="xAxis" label="Year"></igc-category-x-axis>
    <igc-numeric-y-axis  id="yAxis"></igc-numeric-y-axis>
    <igc-range-area-series
        id="series1"
        x-axis-name="xAxis"
        y-axis-name="yAxis"
        high-member-path="High"
        low-member-path="Low">
    </igc-range-area-series>
 </igc-data-chart>
let chart = (document.getElementById("chart") as IgcDataChartComponent);
chart.dataSource = data;

Additional Resources