2012-07-11 69 views
4

標籤我想移動的標籤OFF利用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 2012-07-11 16:47:38

回答

1

試試這個:

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