DevExpress.XtraCharts.ChartControl控件的简单使用 摘自http://leo43.blog.hexun.com/36926221_d.html
来源:互联网 发布:直播截屏软件 编辑:程序博客网 时间:2024/06/05 20:46
DataTable dataTb1 = null; //工资
DataTable dataTb2 = null; //奖金
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
SetTable(ref dataTb1);
SetTable(ref dataTb2);
this.chartControl1.Series.Clear();
Series S1 = new Series("王总工资", ViewType.Bar);
//S1.ArgumentScaleType = ScaleType.Numerical; //X轴的数据类型
Series S2 = new Series("王总奖金", ViewType.Spline);
//S2.ArgumentScaleType = ScaleType.Numerical; //X轴的数据类型
S1.DataSource = dataTb1;
S2.DataSource = dataTb2;
//X轴的数据字段
S1.ArgumentDataMember = "Month";
S2.ArgumentDataMember = "Month";
//Y轴的数据字段
S1.ValueDataMembers[0] = "GongZi";
S2.ValueDataMembers[0] = "GongZi";
this.chartControl1.Series.Add(S1);
this.chartControl1.Series.Add(S2);
}
private void SetTable(ref DataTable dataTb)
{
dataTb = new DataTable("UserInfo");
DataColumn col = new DataColumn( "UserID",typeof(int) );
dataTb.Columns.Add(col);
DataColumn colName = new DataColumn("Month", typeof(string));
dataTb.Columns.Add(colName);
DataColumn colgongzi = new DataColumn("GongZi", typeof(int));//工资
dataTb.Columns.Add(colgongzi);
for (int i = 1; i < 9; i++)
{
Random random = new Random();
DataRow dr = dataTb.NewRow();
dr[0] = i;
dr[1] = i.ToString() + "月";
System.Threading.Thread.Sleep(100);
dr[2] = random.Next(200, 1000);
dataTb.Rows.Add(dr);
}
}
效果图:
可参考: http://www.cnblogs.com/wendy_soft2008/archive/2009/04/01/1427496.html
- DevExpress.XtraCharts.ChartControl控件的简单使用 摘自http://leo43.blog.hexun.com/36926221_d.html
- http://yanghengjun.blog.hexun.com/26226494_d.html
- http://lipingke.blog.hexun.com.tw/39367544_d.html
- 创建一个新的Content Provider (转http://zhuyonghui116.blog.hexun.com/48780045_d.html)
- making of success(http://potato.blog.hexun.com/3690350_d.html)
- 华为EC1260-通话短信 http://majszt.blog.hexun.com/33967361_d.html
- 共享内存---shmget shmat shmdt 分享http://fengxue103.blog.hexun.com/32303320_d.html
- 根据输入日期通过位移方式解决包含当月的前几月自定义函数 http://reportsoft.blog.hexun.com/75077561_d.html
- 【养生保健】对付身体小毛病27妙招集录http://xixipin.blog.hexun.com/17999918_d.html
- DevExpress控件ChartControl简单案例
- DevExpress ChartControl 柱状图的使用
- 新的blog网址为http://supercoder.blog.hexun.com/,欢迎光临!!!
- DevExpress图表控件ChartControl
- 摘自:http://blog.snsgou.com/post-397.html
- http://blog.hexun.com/lotus_west/default.aspx?page=3
- http://blog.hexun.com/lotus_west/default.aspx?page=3
- 浅析ios的MVC开发模式(摘自http://blog.sina.com.cn/s/blog_6ec3c9ce01013owk.html)
- DevExpress ChartControl控件实现图表
- liferay开发(二)开发详细举例--例二
- 如何在Linux下部署web程序(搭建vsftp服务,搭建sshd 服务器,jdk安装步骤,Tomcat安装步骤,MySQL安装步骤)
- josso1.8在tomcat6下安装配置
- 提供的费的风格
- 键盘输入字母显示数字的问题 ——FN键的特殊应用
- DevExpress.XtraCharts.ChartControl控件的简单使用 摘自http://leo43.blog.hexun.com/36926221_d.html
- VC++ WIN32用户界面设计基础之Cursor篇
- AJAX实时读取输入文本
- pku 2385
- S60中使用控件无法显示的解决方法
- AJAX动态获取当前时间
- Dev系列控件之XtraCharts(一)
- 字符串的内聚
- 如何使用iReaper