将标签移出饼图

5
我正在尝试使用VS2010(mvc,ef和asp.net)中的预设图表控件将标签移出饼图。
以下是我用于显示饼图的代码。
  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;

饼图渲染正常,但标签在饼图上,难以阅读。我希望将标签放在图表外部,并用线指向各个部分。谢谢。

1
请查看此链接:http://support2.dundas.com/Default.aspx?article=956 - Quantbuff
1个回答

2

试试这个:

chart.Series["Pie"]["PieLabelStyle"] = "Outside";

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接