首页 > 其他 > 详细

ZedGraph 第三方控件画图功能

时间:2015-03-08 17:02:00      阅读:475      评论: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
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!