📄 graph.h
字号:
//Graph.h - Version 3.0 (Brian Convery, May, 2001)
#if !defined(AFX_GRAPH_H__9DB68B4D_3C7C_47E2_9F72_EEDA5D2CDBB0__INCLUDED_)
#define AFX_GRAPH_H__9DB68B4D_3C7C_47E2_9F72_EEDA5D2CDBB0__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Graph.h : header file
//
//color definitions
#define RED RGB(255,0,0)
#define GREEN RGB(0,255,0)
#define BLUE RGB(0,0,255)
#define YELLOW RGB(255,255,0)
#define ORANGE RGB(255,153,51)
#define HOT_PINK RGB(255,51,153)
#define PURPLE RGB(153,0,204)
#define CYAN RGB(0,255,255)
#define BLACK RGB(0,0,0)
#define WHITE RGB(255,255,255)
#define LAVENDER RGB(199,177,255)
#define PEACH RGB(255,226,177)
#define SKY_BLUE RGB(142,255,255)
#define FOREST_GREEN RGB(0,192,0)
#define BROWN RGB(80,50,0)
#define TURQUOISE RGB(0,192,192)
#define ROYAL_BLUE RGB(0,0,192)
#define GREY RGB(192,192,192)
#define DARK_GREY RGB(128,128,128)
#define TAN RGB(255,198,107)
#define DARK_BLUE RGB(0,0,128)
#define MAROON RGB(128,0,0)
#define DUSK RGB(255,143,107)
#define LIGHT_GREY RGB(225,225,225) //only for 3D graph lines
//for graph type definitions :
//single number = 2D type graph
//number in 20s = 2D type graph related to graph of single number
//number in 30s = 3D type graph related to graph of single number
//graph type definitions
#define BAR_GRAPH 0
#define LINE_GRAPH 1 //lines between plotted points
#define PIE_GRAPH 2
#define SCATTER_GRAPH 3
#define BOX_WHISKER_GRAPH 4
//#define RADAR_GRAPH 5
//specialty graphs
#define STACKED_BAR_GRAPH 20
#define XY_LINE_GRAPH 21 //straight line, no circles at data points
#define BAR_GRAPH_3D 30
#define LINE_GRAPH_3D 31 //looks like a "tape" graph
#define PIE_GRAPH_3D 32
#define STACKED_BAR_GRAPH_3D 320
#define VERTICAL_ALIGN 1
#define HORIZONTAL_ALIGN 0
/////////////////////////////////////////////////////////////////////////////
// CGraph window
#include "GraphDataSet.h"
class CGraph
{
// Construction
public:
CGraph();
CGraph(int type);
// Attributes
public:
private:
CObList* graphDataSet;
int graphType; //0 - bar graph, 1 - line graph, 2 - pie
int graphAlignment; //0 - horizontal, 1 - vertical
int maxHeight;
int maxWidth;
int seriesSize; //number of data elements to map per series
CString graphTitle;
int topYTick;
int rightXTick;
int graphQuadType;
BOOL quadSetManually;
BOOL inRedraw;
CGraphDataSet m_gMinDataSet, m_gMaxDataSet;
// Operations
public:
void DrawGraph(CDC* pDC);
void AddDataSet(CGraphDataSet* dataSet);
void RemoveDataSet(void);
void SetGraphType(int gType);
void SetGraphTitle(CString title);
private:
void DrawDataSet(CDC* pDC);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGraph)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CGraph();
// Generated message map functions
protected:
//{{AFX_MSG(CGraph)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GRAPH_H__9DB68B4D_3C7C_47E2_9F72_EEDA5D2CDBB0__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -