In This Topic
Combo charts are the combination of two or more chart types in a single plot area. For instance, a bar and line chart in a single plot. Combination charts are best used to compare the different data sets that are related to each other, such as actual and target values, total revenue and profit, temperature and precipitation, etc. Note that these charts may require multiple axes to provide different scales for different values.
Sample Image |
Description |
 |
Combo chart can be used to interpret and understand mixed types of data.
This image has a combination of three chart types:
- ColumnClustered
- Line
- Area
|
Using Code
Refer to the following example code to add a combo chart.
|
Copy Code
|
// Add combo chart.
object[,] values = new object[,]
{
{1, 3, 4,7, 8,12 },
{2, 4, 5,12, 2,9 },
{0, 8, 2,1, 12,2 },
};
spreadSheet1.Workbook.ActiveSheet.SetValue(0, 0, values, false);
spreadSheet1.Workbook.ActiveSheet.Cells["A1:F3"].Select();
spreadSheet1.Workbook.ActiveSheet.Shapes.AddChart(GrapeCity.Spreadsheet.Charts.ChartType.ColumnClustered, 200, 150, 400, 400);
spreadSheet1.Workbook.ActiveSheet.ChartObjects[0].Chart.Series[0].ChartType = ChartType.Line;
spreadSheet1.Workbook.ActiveSheet.ChartObjects[0].Chart.Series[0].ChartType = ChartType.Area;
spreadSheet1.Workbook.ActiveSheet.ChartObjects[0].Select();
|
|
Copy Code
|
' Add combo chart.
Dim values = New Object(,) {
{1, 3, 4, 7, 8, 12},
{2, 4, 5, 12, 2, 9},
{0, 8, 2, 1, 12, 2}}
spreadSheet1.Workbook.ActiveSheet.SetValue(0, 0, values, False)
spreadSheet1.Workbook.ActiveSheet.Cells("A1:F3").[Select]()
spreadSheet1.Workbook.ActiveSheet.Shapes.AddChart(GrapeCity.Spreadsheet.Charts.ChartType.ColumnClustered, 200, 150, 400, 400)
spreadSheet1.Workbook.ActiveSheet.ChartObjects(0).Chart.Series(0).ChartType = ChartType.Line
spreadSheet1.Workbook.ActiveSheet.ChartObjects(0).Chart.Series(0).ChartType = ChartType.Area
spreadSheet1.Workbook.ActiveSheet.ChartObjects(0).[Select]()
|