zoukankan      html  css  js  c++  java
  • ZedGraph 第三方控件画图功能

     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
    一分辛苦一分才
  • 相关阅读:
    iOSIPV6简单测试环境搭建
    SQL存儲過程的調試方法
    Excel的 OleDb 连接串的格式
    RequiredFieldValidator的使用
    GridView導出Excel
    咳嗽對症下藥
    WCF基礎
    WCF配置文件全攻略
    WCF寄宿方式
    WCF綁定
  • 原文地址:https://www.cnblogs.com/JoanLin-workNotes/p/4321858.html
Copyright © 2011-2022 走看看