You can create many different types of bar charts such as BarClustered, BarStacked, BarStacked100pc, BarStacked100pc3D, and BarStacked3D. The following image displays a stacked bar chart.
The following sample creates a stacked bar chart.
CS |
Copy Code
|
---|---|
GrapeCity.Windows.SpreadSheet.Data.SpreadChart chart = new GrapeCity.Windows.SpreadSheet.Data.SpreadChart("Chart", GrapeCity.Windows.SpreadSheet.Data.SpreadChartType.BarStacked, "Sheet1!$A$1:$A$7", 0, 0, 200, 200); gcSpreadSheet1.ActiveSheet.SetArray(0, 0, new object[,] { { 1 }, { 2 }, { 3 }, { 4 }, { 5 }, { 6 }, { 7 }, { 8 }, { 9 }, { 10 } }); gcSpreadSheet1.ActiveSheet.Charts.Add(chart); |
VB.NET |
Copy Code
|
---|---|
Dim chart As New GrapeCity.Windows.SpreadSheet.Data.SpreadChart("Chart", GrapeCity.Windows.SpreadSheet.Data.SpreadChartType.BarStacked, "Sheet1!$A$1:$A$7", 0, 0, 200, 200) GcSpreadSheet1.ActiveSheet.SetArray(0, 0, New Object(,) {{1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {9}, {10}}) GcSpreadSheet1.ActiveSheet.Charts.Add(chart) |