Stacked Percent Area charts are displayed with several NAreaSeries objects. The MultiAreaMode property of the first area series must be set to MultiAreaMode.Series. The MultiAreaMode property of the subsequent area series must be set to MultiAreaMode.StackedPercent. The following example demonstrates how to create a Stacked Percent Area chart with three series:
C# |
Copy Code
|
---|---|
// obtain a reference to the Cartesian chart that is created by default
NCartesianChart chart = (NCartesianChart)chartControl.Charts[0];
NAreaSeries area1 = (NAreaSeries)chart.Series.Add(SeriesType.Area);
NAreaSeries area2 = (NAreaSeries)chart.Series.Add(SeriesType.Area);
NAreaSeries area3 = (NAreaSeries)chart.Series.Add(SeriesType.Area);
area1.MultiAreaMode = MultiAreaMode.Series;
area2.MultiAreaMode = MultiAreaMode.StackedPercent;
area3.MultiAreaMode = MultiAreaMode.StackedPercent;
|
Visual Basic |
Copy Code
|
---|---|
' obtain a reference to the Cartesian chart that is created by default Dim chart As NCartesianChart = chartControl.Charts(0) Dim area1 As NAreaSeries = chart.Series.Add(SeriesType.Area) Dim area2 As NAreaSeries = chart.Series.Add(SeriesType.Area) Dim area3 As NAreaSeries = chart.Series.Add(SeriesType.Area) area1.MultiAreaMode = MultiAreaMode.Series area2.MultiAreaMode = MultiAreaMode.StackedPercent area3.MultiAreaMode = MultiAreaMode.StackedPercent |