Step Area Chart

The Ignite UI for Web Components step area chart belongs to a group of category charts and it is rendered using a collection of points connected by continuous vertical and horizontal lines with the area below lines filled in. Values are represented on the y-axis and categories are displayed on the x-axis. IgcStepAreaSeriesComponent emphasizes the amount of change over a period of time or compares multiple items. The Web Components step area chart is identical to the Web Components step line chart in all aspects except that the area below the step lines is filled in.

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 IgcStepAreaSeriesComponent.

Required Data

The IgcStepAreaSeriesComponent 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 IgcStepAreaSeriesComponent.
  • All data items must contain at least one 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 one numeric data column which should be mapped using the ValueMemberPath property of the IgcStepAreaSeriesComponent.

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

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

Required Modules

Creation of the IgcStepAreaSeriesComponent requires the following modules:

// Module Manager:
import { ModuleManager } from 'igniteui-webcomponents-core';
// data chart's modules:
import { IgcDataChartCoreModule } from 'igniteui-webcomponents-charts';
import { IgcDataChartInteractivityModule } from 'igniteui-webcomponents-charts';
import { IgcDataChartCategoryCoreModule } from 'igniteui-webcomponents-charts';
import { IgcDataChartCategoryModule } from 'igniteui-webcomponents-charts';
// axis' modules:
import { IgcNumericYAxisModule } from 'igniteui-webcomponents-charts';
import { IgcNumericXAxisModule } from 'igniteui-webcomponents-charts';
import { IgcCategoryXAxisModule } from 'igniteui-webcomponents-charts';
import { IgcCategoryYAxisModule } from 'igniteui-webcomponents-charts';
// axis' components:
import { IgcNumericYAxisComponent } from 'igniteui-webcomponents-charts';
import { IgcNumericXAxisComponent } from 'igniteui-webcomponents-charts';
import { IgcCategoryXAxisComponent } from 'igniteui-webcomponents-charts';
import { IgcCategoryYAxisComponent } from 'igniteui-webcomponents-charts';
// series' modules:
import { IgcStepAreaSeriesModule } from 'igniteui-webcomponents-charts';
//series' components
import { IgcStepAreaSeriesComponent } from 'igniteui-webcomponents-charts';
// data chart component
import { IgcDataChartComponent } from 'igniteui-webcomponents-charts';

// registering the modules:
ModuleManager.register(
    IgcDataChartCoreModule,
    IgcDataChartInteractivityModule,
    IgcDataChartCategoryCoreModule,
    IgcDataChartCategoryModule,
    IgcStepAreaSeriesModule,
);

Code Example

This code demonstrates how to create an instance of the Ignite UI for Web Components data chart with IgcStepAreaSeriesComponent 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-step-area-series
        id="series1"
        x-axis-name="xAxis"
        y-axis-name="yAxis"
        valueMemberPath="USA">
    </igc-step-area-series>
 </igc-data-chart>
let chart = (document.getElementById("chart") as IgcDataChartComponent);
chart.dataSource = data;

Additional Resources