我们如何将图表绑定到数据列表或中继器 [英] how can we bind chart to datalist or repeater

查看:117
本文介绍了我们如何将图表绑定到数据列表或中继器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以指导我如何将图表绑定到数据列表吗?
我想将以下内容绑定到数据列表

can any one one guide me that how we can bind chart to datalist
i want to bind following to datalist

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();
        

    }

推荐答案

尝试以下链接中的解决方案
http://msdn.microsoft.com/en-us/library/dd456682.aspx [ ^ ]
Try the solution in the following link
http://msdn.microsoft.com/en-us/library/dd456682.aspx[^]


这篇关于我们如何将图表绑定到数据列表或中继器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆