Chart for .NET / User's Guide / Chart Types / Line / Overlapped Line

In This Topic
    Overlapped Line
    In This Topic

    Overlapped lines are similar to standard lines, the only difference being that overlapped line series occupy one and the same depth space. Since this difference cannot be observed in 2D charts, using overlapped mode makes sense only for 3D line charts. The following figure shows an overlapped line chart:




    Figure 1.

     Creating the line series

    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
    
     Related Examples
    Windows forms: Chart Gallery\Line\Overlapped Line
    See Also