Stacked Percent Line charts are displayed with several NLineSeries objects. The MultiLineMode property of the first line series must be set to MultiLineMode.Series. The MultiLineMode property of the subsequent line series must be set to MultiLineMode.StackedPercent. The following example demonstrates how to create a stacked percent line chart with three stacks:
C# |
Copy Code
|
---|---|
// obtain a reference to the Cartesian chart that is created by default
NCartesianChart chart = (NCartesianChart)chartControl.Charts[0];
NLineSeries line1 = (NLineSeries)chart.Series.Add(SeriesType.Line);
NLineSeries line2 = (NLineSeries)chart.Series.Add(SeriesType.Line);
NLineSeries line3 = (NLineSeries)chart.Series.Add(SeriesType.Line);
line1.MultiLineMode = MultiLineMode.Series;
line2.MultiLineMode = MultiLineMode.StackedPercent;
line3.MultiLineMode = MultiLineMode.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 line1 As NLineSeries = chart.Series.Add(SeriesType.Line) Dim line2 As NLineSeries = chart.Series.Add(SeriesType.Line) Dim line3 As NLineSeries = chart.Series.Add(SeriesType.Line) line1.MultiLineMode = MultiLineMode.Series line2.MultiLineMode = MultiLineMode.StackedPercent line3.MultiLineMode = MultiLineMode.StackedPercent |