Hi Everyone, I'm having some trouble creating charts in Excel with C#. I've managed to get a chart of any kind working with the following code:
Excel.Range chartRange;
Excel.ChartObjects xlCharts = (Excel.ChartObjects)xlWorkSheet.ChartObjects(Type.Missing);
Excel.ChartObject myChart = (Excel.ChartObject)xlCharts.Add(10, 80, 300, 250);
Excel.Chart chartPage = myChart.Chart;
chartRange = xlWorkSheet.get_Range("A2", "Y2");
chartPage.SetSourceData(chartRange, misValue);
chartPage.ChartType = Excel.XlChartType.xlColumnClustered;
Unfortunately, I'm not really sure what to do next. Here is what I want to do:
1) There are supposed to be several rows of data, but they are not next to each other (E.g. A2:Y2; A4:Y4; A6:Y6;). How do I add each of these to the chart?
2) A1:Y1 has all of the values for my legend, how would I add this in to the legend?
3) How can I change it so that each chart is created on a new tab?
Thanks!