码迷,mamicode.com
首页 > 其他好文 > 详细

ZedGraph 第三方控件画图功能

时间:2015-03-08 17:04:44      阅读:142      评论:0      收藏:0      [点我收藏+]

标签:

技术分享
 1   ZedGraph. LineItem  curveCurrent ;
 2 
 3            ZedGraph. PointPairList listCurrent= new ZedGraph.PointPairList();
 4 
 5            ZedGraph.ZedGraphControl zedControlCurrent = new ZedGraph.ZedGraphControl ();//定义
 6 
 7           zedControlCurrent.GraphPane.Title.Text = "图像标题" ;//图像名称
 8 
 9            zedControlCurrent.GraphPane.XAxis.Title.Text = DateTime.Now.ToShortDateString();//x轴坐标
10 
11            zedControlCurrent.GraphPane.YAxis.Title.Text = "y轴" ;//y轴
12 
13             this.zedControlCurrent.GraphPane.XAxis.Type = ZedGraph.AxisType.DateAsOrdinal;
14 
15             curveCurrent =zedControlCurrent.GraphPane.AddCurve( "x轴",
16 
17                     listCurrent, Color.DarkOrange, ZedGraph.SymbolType .None);
18 
19             this.zedControlCurrent.GraphPane.XAxis.Scale.Format = "HH:mm:ss";//24小时制,hh:mm:ss 为12小时制
20 
21             this.zedControlCurrent.AxisChange();
22             this.zedControlCurrent.Refresh();
23               listCurrent.Add(time, 3.2);//往其中添加数据
24 
25                 this.zedControlCurrent.AxisChange();
26 
27               zedControlCurrent.SaveAsBitmap(AppDomain.CurrentDomain.BaseDirectory + @"文件夹名称\" +  zedControlCurrent.GraphPane.Title.Text + ".jpeg");//将曲线图保存为jpeg格式
28 
29                 this.zedControlCurrent.Refresh();
View Code

 

ZedGraph 第三方控件画图功能

标签:

原文地址:http://www.cnblogs.com/JoanLin-workNotes/p/4321858.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!