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

C#:ZedGraph画图控件(待补充)

时间:2014-05-08 19:21:43      阅读:530      评论:0      收藏:0      [点我收藏+]

标签:blog   class   code   ext   color   int   

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
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画图控件(待补充),布布扣,bubuko.com

C#:ZedGraph画图控件(待补充)

标签:blog   class   code   ext   color   int   

原文地址:http://www.cnblogs.com/shenchao/p/3713623.html

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