using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using ZedGraph; namespace TestZedGraphControl
{
/// <summary>
/// 画图控件操作类(VS显示控件:工具-->添加项-->选择项-->ZedGraph.dll)
/// </summary>
public class CtlZedGraphOperate
{
private ZedGraphControl m_zedGraphControl = null; /// <summary>
/// 关联ZedGraph画图控件
/// </summary>
public ZedGraphControl refZedGraphControl
{
set
{
m_zedGraphControl = value;
}
get
{
return m_zedGraphControl;
}
} /// <summary>
/// 构造函数
/// </summary>
public CtlZedGraphOperate()
{ } private static volatile CtlZedGraphOperate zgOpera = null; /// <summary>
/// 获取画图控件操作类单一实例
/// </summary>
/// <returns></returns>
public static CtlZedGraphOperate GetInstance()
{
if(null == zgOpera)
{
zgOpera = new CtlZedGraphOperate();
}
return zgOpera;
} /// <summary>
/// 设置标题
/// </summary>
/// <param name="title">图标题</param>
/// <param name="x_title">X轴标题</param>
/// <param name="y_title">Y轴标题</param>
/// <param name="x_type">X轴类型</param>
/// <param name="y_type">Y轴类型</param>
public void SetTitles(string title, string x_title, string y_title)
{
m_zedGraphControl.GraphPane.Title.Text = title;
m_zedGraphControl.GraphPane.XAxis.Title.Text = x_title;
m_zedGraphControl.GraphPane.YAxis.Title.Text = y_title;
} /// <summary>
/// 设置标题(Linear:线性,Exponent:指数,Log:对数,Date:时间,Text:文本,Ordinal:序数,LinearOrdinal:线性序数,DateOrdinal:时间序数)
/// </summary>
/// <param name="title">图标题</param>
/// <param name="x_title">X轴标题</param>
/// <param name="y_title">Y轴标题</param>
/// <param name="x_type">X轴类型</param>
/// <param name="y_type">Y轴类型</param>
public void SetTitles(string title, string x_title, string y_title, AxisType x_type, AxisType y_type)
{
m_zedGraphControl.GraphPane.Title.Text = title;
m_zedGraphControl.GraphPane.XAxis.Title.Text = x_title;
m_zedGraphControl.GraphPane.YAxis.Title.Text = y_title;
m_zedGraphControl.GraphPane.XAxis.Type = x_type;
m_zedGraphControl.GraphPane.YAxis.Type = y_type;
} /// <summary>
/// 依据点集画线
/// </summary>
/// <param name="pointList">点集</param>
public LineItem DrawLines(string label, PointPairList pointList, System.Drawing.Color color, SymbolType symbolType)
{
return m_zedGraphControl.GraphPane.AddCurve(label, pointList, color, symbolType);
} /// <summary>
/// 刷新
/// </summary>
public void ReFresh()
{
m_zedGraphControl.AxisChange();
m_zedGraphControl.Refresh();
}
}
}

C#:ZedGraph画图控件(待补充)的更多相关文章

  1. VS2010 使用TeeChart画图控件 - 之二 - 绘制图形(折线图,柱状图)

    1.前期准备 详细可见VS2010 使用TeeChart画图控件 - 之中的一个 控件和类的导入 1. 1 加入TeeChart控件,给控件加入变量m_TeeChart 加入TeeChart控件,右击 ...

  2. DevExpress控件的安装及画图控件的使用

    近期须要绘制纵断面图,而AE自带的又不是非常好,查找资料后使用DevExpress控件中的画图控件实现了纵断面的绘制.Dev控件是须要付费的.这里我们使用破解版的哈. 安装包及破解文件上传至我的网盘了 ...

  3. TimeSeriesEditor时间序列编辑软件之实战ReoGrid表格控件和Zedgraph绘图控件

    最近用ReoGrid表格控件和Zedgraph绘图控件写了一个TimeSeriesEditor时间序列编辑软件,如下图. 目的就是体验一下这两个空间的用法,感觉还是挺好用的, 关于软件的使用说明可以访 ...

  4. 使用Aspose.Cell控件实现Excel高难度报表的生成(三)

    在之前几篇文章中,介绍了关于Apsose.cell这个强大的Excel操作控件的使用,相关文章如下: 使用Aspose.Cell控件实现Excel高难度报表的生成(一) 使用Aspose.Cell控件 ...

  5. C# 控件

    .ascx:Web窗体用户控件.用来存放独立的用户控件,可提供众多页面使用: <%@ Control Language="C#" AutoEventWireup=" ...

  6. High-speed Charting Control--MFC绘制图表(折线图、饼图、柱形图)控件

    原文地址:https://www.codeproject.com/articles/14075/high-speed-charting-control 本文翻译在CodeProject上的介绍(主要还 ...

  7. 用ZedGraph控件作图圆

    转自原文 用ZedGraph控件作图圆 用ZedGraph控件绘制圆各位:    我想利用第三方控ZedGraph在WinForm窗体中绘制图形如,圆,填充圆,只是简单的圆图形,但一直没有找到相应的方 ...

  8. ZedGraph控件生成饼图、拆线图和柱状图例程

    这几天做了个自己觉得还蛮NB的功能,在GRID中选中一块数据,然后右键菜单即可生成三种图形,还可以互相切换,对了,饼图还添加了鼠标点击分离的处理,大致如图: 用的控件就是ZedGraph,我把它继承封 ...

  9. zedgraph控件的一些比较有用的属性 转

    (1)zedgraph控件属性具体解释: AxisChange()() ->> This performs an axis change command on the graphPane. ...

随机推荐

  1. IDA Bitfields

    Bitfields There is a special kind of enums: bitfields. A bitfield is an enum where the 32bits are di ...

  2. [FireDAC][Phys][MySQL] MySQL server has gone away

    [FireDAC][Phys][MySQL]  MySQL server has gone away 原因: MYSQL等其它数据库,其本质上还是SOCKET服务端. 作为网络通信服务端都有一个机制— ...

  3. 搞定android多点触摸模拟

    原理在android 创建多点触摸虚拟设备,然后往设备写模拟数据可以

  4. KVM-Introduce

    相信非常多的人对虚拟机并不陌生,眼下也有非常多优秀的虚拟机软件,比如:VMware, VirtualBox, Xen, KVM等.而本文的主要内容是介绍KVM. KVM: Kernel Based V ...

  5. Entity Framework7 入门之全功能.NET(Console, WinForms, WPF等)使用EF7

    昨天,我们介绍了EF的新特性和开发计划,如果你还不了解,请移步 Entity Framework7 有哪些不同?现在开发到什么程度了? .今天,我们开学习全功能.NET(Full .NET)下使用EF ...

  6. 将Linux代码移植到Windows的简单方法

    一.前言 Linux拥有丰富各种源代码资源,但是大部分代码在Windows平台情况是无法正常编译的.Windows平台根本无法直接利用这些源代码资源.如果想要使用完整的代码,就要做移植工作.因为C/C ...

  7. appium+python自动化58-xpath定位

    基本属性定位 以淘宝app为例,定位左上角扫一扫按钮 1.可以通过text文本定位到 //*[@text='text文本属性'] # 定位text driver.find_element_by_xpa ...

  8. 获取音视频文件AVMetadata数据

    获取音视频文件AVMetadata数据 问题来源: http://stackoverflow.com/questions/16318821/extracting-mp3-album-artwork-i ...

  9. C++ 函数参数中“ *&代表什么? ”

    typedef struct BitNode  {      char value;      BitNode *lchild,*rchild;    }BitNode,*BiTree; void C ...

  10. js中的this基础

    this在js中的地位可以说是相当高了,本文介绍下this的基本相关情况,以后还会慢慢介绍 在页面中aler(this)//this的指向是window 在DOM操作中this的指向是当前发生事件的对 ...