Click here to Skip to main content
15,912,400 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
can any one one guide me that how we can bind chart to datalist
i want to bind following to datalist
C#
private void LoadChartData() 
    {
        string strcon = ConfigurationManager.ConnectionStrings["gallup"].ConnectionString;
        //SqlConnection myConnection = new SqlConnection(strcon);
        string mystr = "select city, sample from city_breakup";
        SqlDataAdapter da = new SqlDataAdapter(mystr, strcon);
        DataTable table = new DataTable();
        da.Fill(table);

        DataView dv = table.DefaultView;
        
        Chart1.Series["Series1"].Points.DataBindXY(dv, "city", dv, "sample");
        //Chart2.Series["Series1"].Points.DataBindXY(dv, "city", dv, "sample");
        //Chart2.Series["Series1"].ChartType = SeriesChartType.Pie;
        //Chart2.Series["Series1"]["PieLabelStyle"] = "outside";
        //Chart2.Series[0]["PieStartAngle"] = "190";
        //Chart2.Legends.Add("Legend1");
       // DataList1.DataSource = dv;
        //DataList1.DataBind();
        

    }
Posted

1 solution

Try the solution in the following link
http://msdn.microsoft.com/en-us/library/dd456682.aspx[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900