I am experimenting with creating Powerpoint slides out of C#, because I have to create reports out of a tool of mine. The idea to export them to Powerpoint is a given requirement, so I can't change that.
I create and fill a new chart like this:
var shape = objSlide.Shapes.AddChart(XlChartType.xlColumnStacked, 200, 200, 300, 300);
myChart = shape.Chart;
Powerpoint.ChartData pChartData = myChart.ChartData;
Excel.Workbook eWorkbook = (Excel.Workbook)pChartData.Workbook;
Excel.Worksheet eWorksheet = (Excel.Worksheet)eWorkbook.Worksheets[1];
eWorksheet.Cells[2, 1] = "DATA";
//some more Stuff that is not interesting
Now the problem is, that I only need one category, but the default chart creates 3. So I have 3 columns, but I only fill 1 of them. Overwriting them does not work.
Is there a way to change the range to use (like I do in PPT/EXCEL as well by dragging the blue box)?