[]
        
(Showing Draft Content)

Surface Chart

Surface charts are used to plot data on a three-dimensional surface. It is especially useful for finding the optimal combinations between two data sets. Like a topographic map, the colors and patterns on a surface chart indicate the areas that are in the same range of values.

Types of Surface Charts

Spread for WPF supports the following types of Surface charts.

Sample Image

Description

ChartTypeSurface

ChartType.Surface

Represents a surface chart with a 3-D effect.

ChartTypeSurfaceTopView

ChartType.SurfaceTopView

Represents a top-view surface chart.

ChartTypeSurfaceTopViewWireframe

ChartType.SurfaceTopViewWireframe

Represents a top-view surface chart without fill color.

ChartTypeSurfaceWireframe

ChartType.SurfaceWireframe

Represents a surface chart with a 3D visual effect and no fill color.

Using Code

Refer to the following example code to add a surface chart.

C#

// Add data.
spreadSheet1.Workbook.ActiveSheet.Cells[0, 1].Value = "Q1";
spreadSheet1.Workbook.ActiveSheet.Cells[0, 2].Value = "Q2";
spreadSheet1.Workbook.ActiveSheet.Cells[0, 3].Value = "Q3";
spreadSheet1.Workbook.ActiveSheet.Cells[1, 0].Value = "Mobile Phones";
spreadSheet1.Workbook.ActiveSheet.Cells[2, 0].Value = "Laptops";
spreadSheet1.Workbook.ActiveSheet.Cells[3, 0].Value = "Tablets";
for (var r = 1; r <= 3; r++)
{
    for (var c = 1; c <= 3; c++)
    {
        Random random = new Random();
        spreadSheet1.Workbook.ActiveSheet.Cells[r, c].Value = random.Next(0, 100);
    }
}
spreadSheet1.Workbook.ActiveSheet.Cells["A1:D4"].Select();
// Surface chart.
spreadSheet1.Workbook.ActiveSheet.Shapes.AddChart(GrapeCity.Spreadsheet.Charts.ChartType.Surface, 100, 150, 400, 300, false);

VB

' Add data.
spreadSheet1.Workbook.ActiveSheet.Cells(0, 1).Value = "Q1"
spreadSheet1.Workbook.ActiveSheet.Cells(0, 2).Value = "Q2"
spreadSheet1.Workbook.ActiveSheet.Cells(0, 3).Value = "Q3"
spreadSheet1.Workbook.ActiveSheet.Cells(1, 0).Value = "Mobile Phones"
spreadSheet1.Workbook.ActiveSheet.Cells(2, 0).Value = "Laptops"
spreadSheet1.Workbook.ActiveSheet.Cells(3, 0).Value = "Tablets"

For r = 1 To 3
    For c = 1 To 3
        Dim random As Random = New Random()
        spreadSheet1.Workbook.ActiveSheet.Cells(r, c).Value = random.Next(0, 100)
    Next
Next

spreadSheet1.Workbook.ActiveSheet.Cells("A1:D4").[Select]()
' Surface chart.
spreadSheet1.Workbook.ActiveSheet.Shapes.AddChart(GrapeCity.Spreadsheet.Charts.ChartType.Surface, 100, 150, 400, 300, False)