// 新規ワークブックの作成 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.ColumnClustered, 250, 20, 360, 230); worksheet.Range["A1:D6"].Value = new object[,] { { null, "系列1", "系列2", "系列3"}, { "項目1", 10, 25, 25 }, { "項目2", -20, 36, 27 }, { "項目3", 62, 70, -30 }, { "項目4", 22, 65, 65 }, { "項目5", 23, 50, 50 } }; shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D6"], GrapeCity.Documents.Excel.Drawing.RowCol.Columns, true, true); shape.Chart.HasTitle = true; shape.Chart.ChartTitle.Text = "タイトル"; // チャートタイトルの角度を設定 shape.Chart.ChartTitle.Orientation = 30; // xlsx ファイルに保存 workbook.Save("ConfigChartTitleAngle.xlsx");
' 新規ワークブックの作成 Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) Dim shape As IShape = worksheet.Shapes.AddChart(ChartType.ColumnClustered, 250, 20, 360, 230) worksheet.Range("A1:D6").Value = New Object(,) { {Nothing, "系列1", "系列2", "系列3"}, {"項目1", 10, 25, 25}, {"項目2", -20, 36, 27}, {"項目3", 62, 70, -30}, {"項目4", 22, 65, 65}, {"項目5", 23, 50, 50} } shape.Chart.SeriesCollection.Add(worksheet.Range("A1:D6"), RowCol.Columns, True, True) shape.Chart.HasTitle = True shape.Chart.ChartTitle.Text = "タイトル" ' チャートタイトルの角度を設定 shape.Chart.ChartTitle.Orientation = 30 ' xlsx ファイルに保存 workbook.Save("ConfigChartTitleAngle.xlsx")