-
Notifications
You must be signed in to change notification settings - Fork 0
/
ChartDialog.h
82 lines (66 loc) · 1.59 KB
/
ChartDialog.h
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
#pragma once
#include "ChartCtrl.h"
#include "ChartLineSerie.h"
#include "ChartStandardAxis.h"
#include "string.h"
// CChartDialog 对话框
#define WM_USER_ADDDATA WM_USER + 1
enum ENUM_TIME_UNIT
{
_MINUTE,
_SECOND
};
enum ENUM_CHART_TYPE
{
_POINT,
_LINE,
_SURFACE,
_BAR,
_CANDLESTICK,
_GANTT
};
typedef struct ProcessInfo
{
std::string name;
std::string id;
std::string cpu;
std::string mem;
std::string handle;
std::string thread;
std::string nonpaged;
} *PProcessInfo;
class CChartDialog : public CDialogEx
{
DECLARE_DYNAMIC(CChartDialog)
public:
CChartDialog(CWnd* pParent = NULL); // 标准构造函数
virtual ~CChartDialog();
void SetInitParam(std::wstring title, std::wstring leftAxisDes, ENUM_TIME_UNIT unit = ENUM_TIME_UNIT::_MINUTE, const int intervalCount = 1, \
ENUM_CHART_TYPE charttype = ENUM_CHART_TYPE::_LINE);
void AddDataToChart(double Y);
// 对话框数据
enum { IDD = IDD_DLG_CHARTCTRL };
private:
void InitChartCtrl();
CChartCtrl m_ChartCtrl;
CChartDateTimeAxis* m_pBottomTimeAxis;
CChartStandardAxis* m_pLeftAxis;
CChartLineSerie* m_pLineSeries;
std::wstring m_strTitle;
std::wstring m_strLeftAxisDes;
ENUM_TIME_UNIT m_enum_unit;
int m_iIntervalCount;
ENUM_CHART_TYPE m_enum_charttype;
COleDateTime m_minDateTime;
COleDateTime m_maxDateTime;
COleDateTimeSpan m_span;
double m_yAxisMin;
double m_yAxisMax;
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV 支持
DECLARE_MESSAGE_MAP()
public:
virtual BOOL OnInitDialog();
virtual BOOL PreTranslateMessage(MSG* pMsg);
afx_msg LRESULT OnAddDataToChart(WPARAM wParam, LPARAM lParam);
};