i have a chart from two columns. In Column A are some result % values and in B i have the corresponding Name to the value.
A B
90 Test1
82 Test2
66 Test3
I want the A values as Y axis and already managed that, but i can´t get the names from B to the X-Axis labels.
Range chartRange;
Worksheet xlWorkSheet = (Worksheet)xlWorkBook.Worksheets[1];
ChartObjects xlCharts = (ChartObjects)xlWorkSheet.ChartObjects(Type.Missing);
ChartObject myChart = (ChartObject)xlCharts.Add(10, 80, 300, 250);
Chart chartPage = myChart.Chart;
chartRange = xlWorkSheet.get_Range("A1:B"+movieCount.ToString(), Type.Missing);
chartPage.SetSourceData(chartRange, misValue);
chartPage.ChartType = XlChartType.xlColumnClustered;
You will have to adapt to these settings, otherwise your xvalues will be just a count:
or
maby there is a another way, but as a quick solution, this would work in VBA – so it should too, when you adapt it to your C# version.