Spline Chart

The Ignite UI for Web Components spline chart belongs to a group of category charts and is rendered using a collection of points connected by smooth curves of spline. Values are represented on the y-axis and categories are displayed on the x-axis. IgcSplineSeriesComponent emphasizes the amount of change over a period of time or compares multiple items as well as the relationship of parts to a whole by displaying the total of the plotted values. The Web Components spline chart is identical to the Web Components line chart in all aspects except that line connecting data points has spline interpolation and smoothing for improved presentation of data.

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

Required Data

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

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

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

Required Modules

Creation of the IgcSplineSeriesComponent 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 { IgcSplineSeriesModule } from 'igniteui-webcomponents-charts';
import { ModuleManager } from 'igniteui-webcomponents-core';

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

Code Example

This code demonstrates how to create an instance of the Ignite UI for Web Components data chart with IgcSplineSeriesComponent 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-spline-series
        name="series1"
        x-axis-name="xAxis"
        y-axis-name="yAxis"
        value-member-path="USA">
    </igc-spline-series>
    <igc-spline-series
        name="series2"
        x-axis-name="xAxis"
        y-axis-name="yAxis"
        value-member-path="RUS">
    </igc-spline-series>
</igc-data-chart>
let chart = document.getElementById("chart") as IgcDataChartComponent;
chart.dataSource = SampleCategoryData.create();

Additional Resources