//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} }; worksheet.Range["A:A"].Columns.AutoFit(); //Create a funnel chart. IShape shape = worksheet.Shapes.AddChart(ChartType.Funnel, 300, 20, 300, 200); shape.Chart.SeriesCollection.Add(worksheet.Range["A1:B7"]); //Set the axis invisible. IAxis axis = shape.Chart.Axes.Item(AxisType.Category, AxisGroup.Primary); axis.Visible = false; // Save to an excel file workbook.Save("AddFunnelChart.xlsx");
' 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} } worksheet.Range("A:A").Columns.AutoFit() 'Create a funnel chart. Dim shape As IShape = worksheet.Shapes.AddChart(ChartType.Funnel, 300, 20, 300, 200) shape.Chart.SeriesCollection.Add(worksheet.Range("A1:B7")) 'Set the axis invisible. Dim axis As IAxis = shape.Chart.Axes.Item(AxisType.Category, AxisGroup.Primary) axis.Visible = False ' save to an excel file workbook.Save("AddFunnelChart.xlsx")