Step Line Chart

The Ignite UI for Web Components step line chart belongs to a group of category charts and it is rendered using a collection of points connected by continuous vertical and horizontal lines forming a step-like progression. Values are represented on the y-axis and categories are displayed on the x-axis. IgcStepLineSeriesComponent emphasizes the amount of change over a period of time or compares multiple items. The Web Components step line chart is identical to the Web Components step area chart in all aspects except that the area below the step lines is not 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 IgcStepLineSeriesComponent.

Required Data

The IgcStepLineSeriesComponent 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 IgcStepLineSeriesComponent.
  • 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 IgcStepLineSeriesComponent.

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

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

Required Modules

Creation of the IgcStepLineSeriesComponent requires the following modules:

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

// registering data chart's modules:
ModuleManager.register(
    IgcDataChartCoreModule,
    IgcDataChartCategoryModule,
    IgcDataChartInteractivityModule,
    IgcStepLineSeriesModule
);

Code Example

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

<igc-data-chart id="chart" width="100%" height="100%"
    is-horizontal-zoom-enabled="true"
    is-vertical-zoom-enabled="true">
    <igc-category-x-axis name="xAxis" label="Year"></igc-category-x-axis>
    <igc-numeric-y-axis name="yAxis" ></igc-numeric-y-axis>
    <igc-step-line-series
        name="series1"
        x-axis-name="xAxis"
        y-axis-name="yAxis"
        value-member-path="USA">
    </igc-step-line-series>
    <igc-step-line-series
        name="series2"
        x-axis-name="xAxis"
        y-axis-name="yAxis"
        value-member-path="RUS">
    </igc-step-line-series>
</igc-data-chart>
let chart = document.getElementById("chart") as IgcDataChartComponent;
chart.dataSource = SampleCategoryData.create();

Additional Resources