Overlapped Line charts are displayed with several NLineSeries objects. The MultiLineMode property of the first line series must be set to MultiLineMode.Series. For the subsequent series the MultiLineMode property must be set to MultiLineMode.Overlapped. The following example demonstrates how to create an overlapped line chart with two line series:
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);
line1.MultiLineMode = MultiLineMode.Series;
line2.MultiLineMode = MultiLineMode.Overlapped;
|
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) line1.MultiLineMode = MultiLineMode.Series line2.MultiLineMode = MultiLineMode.Overlapped |
If you want to create a second overlapped line group with two lines behind the overlapped line created in the previous sample you must add the following code:
C# |
Copy Code
|
---|---|
NLineSeries line4 = (NLineSeries)chart.Series.Add(SeriesType.Line); NLineSeries line5 = (NLineSeries)chart.Series.Add(SeriesType.Line); line4.MultiLineMode = MultiLineMode.Series; line5.MultiLineMode = MultiLineMode.Overlapped; |
Visual Basic |
Copy Code
|
---|---|
Dim line4 As NLineSeries = chart.Series.Add(SeriesType.Line) Dim line5 As NLineSeries = chart.Series.Add(SeriesType.Line) line4.MultiLineMode = MultiLineMode.Series line5.MultiLineMode = MultiLineMode.Overlapped |