I am trying to move the labels OFF of the pie chart using the canned chart control from VS2010 (mvc, ef and asp.net)
Here is my code to display the 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 rendered ok, but the labels are on the pie chart, and it is too hard to read. I would like to labels placed off the chart with lines pointing to the segment.
thanks
Try this:
chart.Series["Pie"]["PieLabelStyle"] = "Outside";
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With