I am referring to the bar chart code to create a pie chart but i am getting error I have made some modifications
using GemBox.Presentation;
using spreedsheetCharts = GemBox.Spreadsheet.Charts;
using spreedsheet = GemBox.Spreadsheet;
// Add new PowerPoint presentation slide.
// If using the Professional version, put your GemBox.Presentation serial key below.
ComponentInfo.SetLicense("FREE-LIMITED-KEY");
// If using the Professional version, put your GemBox.Spreadsheet serial key below.
SpreadsheetInfo.SetLicense("FREE-LIMITED-KEY");
var firstLastSlidesPresentation= new PresentationDocument();
var slide = firstLastSlidesPresentation.Slides.AddNew(SlideLayoutType.Custom);
// Add simple PowerPoint presentation title.
var textBox = slide.Content.AddTextBox(ShapeGeometryType.Rectangle,
116.8, 20, 105, 10, GemBox.Presentation.LengthUnit.Millimeter);
textBox.AddParagraph().AddRun("New presentation with chart element.");
// Create PowerPoint chart and add it to slide.
var chart = slide.Content.AddChart(GemBox.Presentation.ChartType.Bar,
49.3, 40, 240, 120, GemBox.Presentation.LengthUnit.Millimeter);
// Get underlying Excel chart.
spreedsheetCharts.ExcelChart excelChart = (spreedsheetCharts.ExcelChart)chart.ExcelChart;
spreedsheet.ExcelWorksheet worksheet = excelChart.Worksheet;
// Add data for Excel chart.
worksheet.Cells["A1"].Value = "Name";
worksheet.Cells["A2"].Value = "John Doe";
worksheet.Cells["A3"].Value = "Fred Nurk";
worksheet.Cells["A4"].Value = "Hans Meier";
worksheet.Cells["A5"].Value = "Ivan Horvat";
worksheet.Cells["B1"].Value = "Salary";
worksheet.Cells["B2"].Value = 3600;
worksheet.Cells["B3"].Value = 2580;
worksheet.Cells["B4"].Value = 3200;
worksheet.Cells["B5"].Value = 4100;
// Select data.
excelChart.SelectData(worksheet.Cells.GetSubrange("A1:B5"), true);
firstLastSlidesPresentation.save("somename.pptx")
error -
‘ExcelChart’ does not contain a definition for ‘Worksheet’ and no accessible extension method ‘Worksheet’ accepting a first argument of type ‘ExcelChart’ could be found (are you missing a using directive or an assembly reference?)
please help me with this issue