Moving labels from a pie chart

I am trying to move shortcuts to a pie chart using the managed chart control from VS2010 (mvc, ef and asp.net).

Here is my code to display piechart.

string xx = activePhysicianID; ArrayList xValue = new ArrayList(); ArrayList yValue = new ArrayList(); XXXXX_MainEntities dbContext = new XXXXX_MainEntities(); var results = dbContext.Payor.Where(rs => rs.PhysicianIdentity.Equals(xx)); results.ToList().ForEach(rs => xValue.Add(rs.Identifier)); results.ToList().ForEach(rs => yValue.Add(rs.Strength)); var chart = new Chart(600, 300, ChartTheme.Blue); chart.AddSeries(chartType: "Pie", xValue: xValue, yValues: yValue); chart.AddTitle("Payor"); chart.Write("png"); return null; 

The pie chart is displayed in order, but the labels are on the pie chart and it is too difficult to read. I would like the labels to fit in a table with lines pointing to the segment.

thanks

+4
source share
1 answer

Try the following:

 chart.Series["Pie"]["PieLabelStyle"] = "Outside"; 
+1
source

All Articles