//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; GrapeCity.Documents.Excel.Drawing.IShape shape = worksheet.Shapes.AddChart(GrapeCity.Documents.Excel.Drawing.ChartType.BarClustered, 250, 20, 360, 230); worksheet.Range["A1:D2"].Value = new object[,] { { 100,200,300,400 }, { 100,200,300,400 }, }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D2"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns); shape.Chart.ChartTitle.Text = "Bar Clustered Chart"; shape.Chart.Legend.Position = GrapeCity.Documents.Excel.Drawing.LegendPosition.Left; // Save to an excel file workbook.Save("BarClusteredChart.xlsx");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) Dim shape As IShape = worksheet.Shapes.AddChart(ChartType.BarClustered, 250, 20, 360, 230) worksheet.Range("A1:D2").Value = New Object(,) { {100, 200, 300, 400}, {100, 200, 300, 400} } shape.Chart.SeriesCollection.Add(worksheet.Range("A1:D2"), RowCol.Columns) shape.Chart.ChartTitle.Text = "Bar Clustered Chart" shape.Chart.Legend.Position = LegendPosition.Left ' save to an excel file workbook.Save("BarClusteredChart.xlsx")