Tuesday, September 9, 2014

Binding Pie Chart Asp .Net with Dictionary?


Step1: Making Dictionary

Dictionary<string,int> dic=new Dictionary<string,int>();

dic.Add("Done",10);
dic.Add("Pending",2);
dic.Add("InProgress",4);

Step2: Binding

    Chart1.DataSource = dic;
    foreach (KeyValuePair<string, int> progress in data)
    {
    Chart1.Series[0].Points.AddXY(progress.Key, progress.Value);
    }
    Chart1.DataBind();


No comments:

Post a Comment

Secure you Asp .NET by Web.config & Global.ascx?

Add to Global.ascx protected void Application_BeginRequest(object sender,EventArgs e)     {         //to remove x frame         Resp...