LineChart.h
上传用户:hbytqc8
上传日期:2014-07-31
资源大小:527k
文件大小:2k
源码类别:

SNMP编程

开发平台:

Visual C++

  1. // LineChart.h: interface for the CLineChart class.
  2. //
  3. //////////////////////////////////////////////////////////////////////
  4. #if !defined(AFX_LINECHART_H__754AC4E3_07E2_4566_8B88_16C1ACC0BDDB__INCLUDED_)
  5. #define AFX_LINECHART_H__754AC4E3_07E2_4566_8B88_16C1ACC0BDDB__INCLUDED_
  6. #if _MSC_VER > 1000
  7. #pragma once
  8. #endif // _MSC_VER > 1000
  9. #include "AfxTempl.h"
  10. class CLineChart : public CStatic
  11. {
  12. public:
  13. CLineChart(CSize cs,int row);
  14. // Attributes
  15. protected:
  16. int StartPos;
  17. int oldX,oldY;
  18. bool Cross,Useage;
  19. CString title,xLegend,yLegend;
  20. CFont tFont; 
  21. CSize ChartSize; 
  22. int Count;
  23. unsigned long Number,yMax,Temp_yMax;
  24. unsigned long xAverage,yAverage;
  25. unsigned long x_Max,x_Min,y_Max,y_Min;
  26. int interval;
  27. struct LineData
  28. {
  29. unsigned long x;
  30. unsigned long y;
  31. int xUse;
  32. int yUse;
  33. CString xTime;
  34. bool show;
  35. };
  36. CArray <LineData,LineData&> ArrayData;
  37. // Operations
  38. public:
  39. void Append(unsigned long  x1,unsigned long  y1,CString tt,int ux,int uy);
  40. void Init();
  41. void SetTitle(CString str);
  42. void SetLegend(CString xStr,CString yStr);
  43. void SetCross(bool tf);
  44. unsigned long GetXAverage();
  45. unsigned long GetYAverage();
  46. void AddData(unsigned long  x1,unsigned long  y1,CString tt,
  47.  int ux,int uy,int index,bool tf);
  48. void ToLeft();
  49. void ToRight();
  50. void SetUse(bool tf);
  51. CString GetXMax();
  52. CString GetYMax();
  53. CString GetXMin();
  54. CString GetYMin();
  55. //void ChangeInt(int x);
  56. // Overrides
  57. // ClassWizard generated virtual function overrides
  58. //{{AFX_VIRTUAL(CLineChart)
  59. //}}AFX_VIRTUAL
  60. // Implementation
  61. public:
  62. virtual ~CLineChart();
  63. // Generated message map functions
  64. protected:
  65. //{{AFX_MSG(CLineChart)
  66. afx_msg void OnPaint();
  67. afx_msg void OnMouseMove(UINT nFlags, CPoint point);
  68. //}}AFX_MSG
  69. DECLARE_MESSAGE_MAP()
  70. };
  71. #endif // !defined(AFX_LINECHART_H__754AC4E3_07E2_4566_8B88_16C1ACC0BDDB__INCLUDED_)