2012-04-02 7 views

Antwort

1

einen Blick auf das folgende Beispiel haben, für das Verfahren Sie suchen ist callled - AddXY:

using System; 
using System.Collections.Generic; 
using System.Web.UI.DataVisualization.Charting; 

namespace WebApplication1 
{ 
    public partial class WebForm1 : System.Web.UI.Page 
    { 
     protected void Page_Load(object sender, EventArgs e) 
     { 
      Dictionary<int, string> employees = new Dictionary<int, string>(); 

      employees.Add(10, "Product A"); 
      employees.Add(20, "Product B"); 
      employees.Add(30, "Product C"); 

      Chart1.Series[0].ChartType = SeriesChartType.Bar; 

      foreach (KeyValuePair<int, string> employee in employees) 
      { 
       Chart1.Series[0].Points.AddXY(employee.Value, employee.Key); 
      } 
     } 
    } 
} 

ASP.NET MS Chart control

Verwandte Themen