首页 > 其他 > 详细

DevExpress控件之:ChartControl 动态绑定数据

时间:2015-01-15 19:59:47      阅读:845      评论:0      收藏:0      [点我收藏+]
private void BindData(ViewType vt)
        {
            chartControl1.Series.Clear();
            //Series series1 = new Series("日志统计", ViewType.RadarArea);
            Series series1 = new Series("日志统计", vt);
             
            chartControl1.Series.Add(series1);
            string sSQL = string.Format("select code,baseprice from tRoomType");
            DataTable tableMain = SqlLiteHelper.GetDataTable(out sError, sSQL);
            tableMain.TableName = "主表";

            SeriesPoint point = null;
            foreach (DataRow row in tableMain.Rows)
            {
                if (row["code"] != null)
                {
                    point = new SeriesPoint(row["code"].ToString());
                    double[] vals = { Convert.ToDouble(row["baseprice"]) };
                    point.Values = vals;
                    series1.Points.Add(point);
                }
            }
        }

DevExpress控件之:ChartControl 动态绑定数据

原文:http://www.cnblogs.com/zhangruisoldier/p/4226950.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!