//create a new workbook var workbook = new GrapeCity.Documents.Excel.Workbook(); IWorksheet worksheet = workbook.Worksheets[0]; worksheet.Range["A1:B7"].Value = new object[,] { {"Stage", "Amount"}, {"Prospects", 500}, {"Qualified prospects", 425}, {"Needs analysis", 200}, {"Price quotes", 150}, {"Negotiations", 100}, {"Closed sales", 90} }; //Set cell style. worksheet.Range["A:A"].Columns.AutoFit(); worksheet.Range["B2:B7"].NumberFormat = "$#,##0.00"; //Create a funnel chart. IShape shape = worksheet.Shapes.AddChart(ChartType.Funnel, 10, 150, 300, 200); shape.Chart.SeriesCollection.Add(worksheet.Range["A1:B7"]); //Set funnel chart style. shape.Chart.ChartTitle.Text = "Funnel Chart"; foreach (var s in shape.Chart.SeriesCollection) { s.DataLabels.Font.Color.RGB = Color.White; } // Save to a pdf file workbook.Save("FunnelChartPdf.pdf");
' Create a new Workbook Dim workbook As New Workbook Dim worksheet As IWorksheet = workbook.Worksheets(0) worksheet.Range("A1:B7").Value = New Object(,) { {"Stage", "Amount"}, {"Prospects", 500}, {"Qualified prospects", 425}, {"Needs analysis", 200}, {"Price quotes", 150}, {"Negotiations", 100}, {"Closed sales", 90} } 'Set cell style. worksheet.Range("A:A").Columns.AutoFit() worksheet.Range("B2:B7").NumberFormat = "$#,##0.00" 'Create a funnel chart. Dim shape As IShape = worksheet.Shapes.AddChart(ChartType.Funnel, 10, 150, 300, 200) shape.Chart.SeriesCollection.Add(worksheet.Range("A1:B7")) 'Set funnel chart style. shape.Chart.ChartTitle.Text = "Funnel Chart" For Each s In shape.Chart.SeriesCollection s.DataLabels.Font.Color.RGB = Color.White Next s ' save to a pdf file workbook.Save("FunnelChartPdf.pdf")