title: c# excel radar chart - how to change horizontal axis?
body: <p>In my WPF application I allready exported data to Excel to plot them in a radar chart, just to re-import this chart to the application. I need to do this for real-time analysis of the data and with WPF toolkit I couldn't create radar charts yet (I spend lot of time by searching for a solution before I got to Excel).</p>
  
  <p>My problem now is, that I cant change the horizontal axis of the radar chart via C#. In Excel itself I would do that easy by setting up the chart options, but in my code I didn't got a clue yet what to do and also in debugging I didn't find any chart item, that told me more. My code so far is following:</p>
  
  <pre><code>Excel.Application application = new Excel.Application();
  Excel.Workbook workbook = application.Workbooks.Open(fileName);
  Excel.Worksheet worksheet = workbook.Worksheets[1] as Excel.Worksheet;
  CreateData(worksheet, sortangle, sortmu);
  
  // Add chart.
  Excel.ChartObjects xlCharts = worksheet.ChartObjects() as Excel.ChartObjects;
  Excel.ChartObject myChart = xlCharts.Add(120, 10, 300, 300) as Excel.ChartObject;
  Excel.Chart chart = myChart.Chart;
  
  chart.ChartType = Excel.XlChartType.xlRadar;
  var scale_range = worksheet.get_Range("A1", "A" + sortangle.Count.ToString());
  var data_range = worksheet.get_Range("B1", "B" + sortangle.Count.ToString());
  chart.SetSourceData(data_range);
  chart.HasLegend = false;
  
  // Set chart properties.
  chart.ChartWizard(Source: data_range);
  </code></pre>
  
  <p>So with this I get such a result:</p>
  
  <p><a href="https://i.stack.imgur.com/PiWdW.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PiWdW.jpg" alt="enter image description here"></a></p>
  
  <p>But the rotation axis need to be scaled by 0 to 360 degree, cause the data I process are stored with the information of an angle.</p>
  
  <p>So I tried, by looking to other C# Excel like questions here e.g. <a href="https://stackoverflow.com/questions/12492434/c-sharp-excel-chart-with-custom-x-axis">this one</a>, adding different lines like <code>chart.SeriesCollection(1).XValues = scale_range;</code> or <code>chart.Axes(Excel.XlAxisType.xlValue).Source = scale_range;</code>. Even by changing the <code>ChartWizard</code> to <code>chart.ChartWizard(Source: data_range, SeriesLabels: scale_range);</code> I didn't got far.</p>
  
  <p>For any suggestions I would be grateful.</p>
  
  <p>EDIT:
  By checking the code you may see, that <code>scale_range</code> is not used atm. I also tried to bring it in the <code>data_range</code> item, but then I get two lines.</p>