Stacked 100 Column Chart
The Ignite UI for Web Components stacked 100 column chart belongs to a group of category charts and is rendered using a collection of rectangles (IgcStackedFragmentSeriesComponent) that are stacked on top of each other. Each stacked fragment in the collection represents one visual element in each stack. Each stack can contain both positive and negative values. All positive values are grouped on the positive side of the y-axis, and all negative values are grouped on the negative side of the y-axis. The Web Components stacked 100 column chart is identical to the Web Components stacked column chart in all aspects except in their treatment of the values on y-axis. Instead of presenting a direct representation of the data, the stacked 100 bar chart presents the data in terms of percent of the sum of all values in a data point. In addition, the IgcStacked100ColumnSeriesComponent uses the same concepts of data plotting as IgcStacked100BarSeriesComponent but data points are stacked along vertical line (y-axis) rather than along horizontal line (x-axis). In other words, the stacked 100 column chart is rendered like the stacked 100 bar chart but with 90 degrees counter-clockwise rotation.
Demo
The IgcStacked100ColumnSeriesComponent has its own IgcSeriesComponent collection in which you can place the IgcStackedFragmentSeriesComponent elements. These fragments are what make up the actual rendering of the chart and are the elements that accept the valueMemberPath.
Required Axes
The Web Components data chart component provides various types of axes but only the following types of axes can be used with IgcStacked100ColumnSeriesComponent.
IgcCategoryXAxisComponentIgcOrdinalTimeXAxisComponentIgcTimeXAxisComponentIgcNumericYAxisComponent
Required Data
The IgcStacked100ColumnSeriesComponent 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
IgcStacked100ColumnSeriesComponent. - All data items must contain at least one data column (string or date time) which should be mapped to the
Labelproperty of the category axis (e.g.IgcCategoryXAxisComponent). - All data items must contain at least one numeric data column which should be mapped using the
ValueMemberPathproperty of theIgcStackedFragmentSeriesComponentto be added to theIgcStacked100ColumnSeriesComponent'IgcSeriesComponentcollection.
Required Modules
Creation of the IgcStacked100ColumnSeriesComponent requires the following modules:
import { IgcDataChartComponent } from 'igniteui-webcomponents-charts';
import { IgcDataChartCoreModule } from 'igniteui-webcomponents-charts';
import { IgcDataChartCategoryModule } from 'igniteui-webcomponents-charts';
import { IgcDataChartStackedModule } from 'igniteui-webcomponents-charts';
import { IgcStackedFragmentSeriesModule } from 'igniteui-webcomponents-charts';
import { ModuleManager } from 'igniteui-webcomponents-core';
ModuleManager.register(
IgcDataChartCoreModule,
IgcDataChartCategoryModule,
IgcDataChartStackedModule,
IgcStackedFragmentSeriesModule,
);
Code Example
This code demonstrates how to create an instance of the Ignite UI for Web Components data chart with IgcStacked100ColumnSeriesComponent and bind it to a data source.
<igc-data-chart id="chart" width="100%" height="100%">
<igc-category-x-axis name="xAxis" label="Country"></igc-category-x-axis>
<igc-numeric-y-axis name="yAxis" minimum-value="0"></igc-numeric-y-axis>
<igc-stacked-100-column-series name="series" x-axis-name="xAxis" y-axis-name="yAxis">
<igc-stacked-fragment-series name="coal" value-member-path="Coal" title="Coal"></igc-stacked-fragment-series>
<igc-stacked-fragment-series name="hydro" value-member-path="Hydro" title="Hydro"></igc-stacked-fragment-series>
<igc-stacked-fragment-series name="nuclear" value-member-path="Nuclear" title="Nuclear"></igc-stacked-fragment-series>
<igc-stacked-fragment-series name="gas" value-member-path="Gas" title="Gas"></igc-stacked-fragment-series>
<igc-stacked-fragment-series name="oil" value-member-path="Oil" title="Oil"></igc-stacked-fragment-series>
</igc-stacked-100-column-series>
</igc-data-chart>