// 新規ワークブックの作成 var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; worksheet.Range["A1:D16"].Value = new object[,] { {"四半期", "月", "週", "出来高"}, {"Q1", "1月", null, 3.5}, {null, "2月", "第1週", 1.2}, {null, null, "第2週", 0.8}, {null, null, "第3週", 0.6}, {null, null, "第4週", 0.5}, {null, "3月", null, 1.7 }, {"Q2", "4月", null, 1.1}, {null, "5月", null, 0.8}, {null, "6月", null, 0.3}, {"Q3", "7月", null, 0.7}, {null, "8月", null, 0.6}, {null, "9月", null, 0.1}, {"Q4", "10月", null, 0.5}, {null, "11月", null, 0.4}, {null, "12月", null, 0.3}, }; // サンバーストチャートを作成 IShape shape = worksheet.Shapes.AddChart(Drawing.ChartType.Sunburst, 20, 320, 380, 380); shape.Chart.SeriesCollection.Add(worksheet.Range["A1:D16"]); // チャートのタイトルテキストを変更 shape.Chart.ChartTitle.Text = "年次報告"; // PDF ファイルに保存 workbook.Save("SunburstChartPdf.pdf");
' 新規ワークブックの作成 Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) worksheet.Range("A1:D16").Value = New Object(,) { {"四半期", "月", "週", "出来高"}, {"Q1", "1月", Nothing, 3.5}, {Nothing, "2月", "第1週", 1.2}, {Nothing, Nothing, "第2週", 0.8}, {Nothing, Nothing, "第3週", 0.6}, {Nothing, Nothing, "第4週", 0.5}, {Nothing, "3月", Nothing, 1.7}, {"Q2", "4月", Nothing, 1.1}, {Nothing, "5月", Nothing, 0.8}, {Nothing, "6月", Nothing, 0.3}, {"Q3", "7月", Nothing, 0.7}, {Nothing, "8月", Nothing, 0.6}, {Nothing, "9月", Nothing, 0.1}, {"Q4", "10月", Nothing, 0.5}, {Nothing, "11月", Nothing, 0.4}, {Nothing, "12月", Nothing, 0.3} } ' サンバーストチャートを作成 Dim shape As IShape = worksheet.Shapes.AddChart(ChartType.Sunburst, 20, 320, 380, 380) shape.Chart.SeriesCollection.Add(worksheet.Range("A1:D16")) ' チャートのタイトルテキストを変更 shape.Chart.ChartTitle.Text = "年次報告" ' PDF ファイルに保存 workbook.Save("SunburstChartPdf.pdf")