|
|
#pragma once
|
|
|
#ifndef ChartBaseObject_h__
|
|
|
#define ChartBaseObject_h__
|
|
|
|
|
|
#include "drawingobject.h"
|
|
|
#include "CommonDefine.h"
|
|
|
#include "ChartDataSet.h"
|
|
|
|
|
|
namespace NChart
|
|
|
{
|
|
|
|
|
|
class CChartDataSet;
|
|
|
class CLegendManager;
|
|
|
class CAxisManager;
|
|
|
|
|
|
class AFX_EXT_CLASS CChartBaseObject :
|
|
|
public CDrawingObject
|
|
|
{
|
|
|
public:
|
|
|
CChartBaseObject(void);
|
|
|
virtual ~CChartBaseObject(void);
|
|
|
|
|
|
virtual void SetDataFilePath(CString dataFilePath);
|
|
|
virtual CString GetDataFilePath();
|
|
|
|
|
|
virtual CChartDataSet *GetDataSet();
|
|
|
virtual void SetDataSet(CChartDataSet * pDataSet);
|
|
|
virtual void SetRect(const CRect8& rcClient);
|
|
|
virtual CDrawingObject* HitTest(const CPoint2D& ptHit);
|
|
|
|
|
|
|
|
|
virtual void SetPlotBackgroundColor(COLORREF color);
|
|
|
virtual COLORREF GetPlotBackgroundColor();
|
|
|
virtual void SetChartBackgroundColor(COLORREF color);
|
|
|
virtual COLORREF GetChartBackgroundColor();
|
|
|
virtual void SetAlpha(int alpha);
|
|
|
virtual int GetAlpha();
|
|
|
virtual bool GetShowVGridLine() { return m_bShowVGridLine; }
|
|
|
virtual void SetShowVGridLine(bool val);
|
|
|
virtual bool GetShowHGridLine() { return m_bShowHGridLine; }
|
|
|
|
|
|
virtual void SetShowHGridLine(bool val);
|
|
|
|
|
|
virtual void SetStandardFont(GDFLOGFONT font);
|
|
|
virtual void InitUnitLength();
|
|
|
virtual void SetUnitLength(double unitLen);
|
|
|
|
|
|
virtual NGraph::GDFLOGFONT GetPlotFont() const { return m_fontPlot; }
|
|
|
virtual void SetPlotFont(NGraph::GDFLOGFONT font) { m_fontPlot = font; }
|
|
|
|
|
|
void SetCoustomFont(GDFLOGFONT &font);
|
|
|
|
|
|
bool GetAutoFont() const { return m_bAutoFont; }
|
|
|
void SetAutoFont(bool val) { m_bAutoFont = val; }
|
|
|
|
|
|
protected:
|
|
|
virtual void Layout();
|
|
|
virtual void CreateLegend();
|
|
|
virtual void CreateAxis();
|
|
|
void CreateLegendWithField();
|
|
|
void CreateLegendWithRowName();
|
|
|
void CalcPlotArea();
|
|
|
COLORREF GetEnumColor(int i);
|
|
|
|
|
|
|
|
|
CChartDataSet * m_pData;
|
|
|
CLegendManager* m_pLegendMgr;
|
|
|
CAxisManager* m_pAxisMgr;
|
|
|
LAYOUTPOS m_eLegendPos;
|
|
|
CString m_dataFilePath;
|
|
|
COLORREF m_plotBackgroundColor;
|
|
|
COLORREF m_chartBackgroundColor;
|
|
|
int m_iAlpha;
|
|
|
|
|
|
double m_dAxisAreaScale;
|
|
|
double m_dLegendAreaScale;
|
|
|
double m_dMarginAreaScale;
|
|
|
double m_dTitleAreaScale;
|
|
|
|
|
|
|
|
|
// <20><>ͼ<EFBFBD><CDBC><EFBFBD>ͱ<EFBFBD>ע<EFBFBD><D7A2>
|
|
|
CRect8 m_rcPlot;
|
|
|
CRect8 m_rcGraph;
|
|
|
CRect8 m_rcLegend;
|
|
|
CRect8 m_rcCoordinateHT; //<2F><><EFBFBD><EFBFBD>ˮƽ<CBAE><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
CRect8 m_rcCoordinateHB; //<2F>ײ<EFBFBD>ˮƽ<CBAE><C6BD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
CRect8 m_rcCoordinateVL; //<2F><><EFBFBD><EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
CRect8 m_rcCoordinateVR; //<2F>Ҵ<EFBFBD>ֱ<EFBFBD><D6B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
|
|
CRect8 m_rcTitle;
|
|
|
bool m_bShowLegend;
|
|
|
bool m_bShowVGridLine;
|
|
|
bool m_bShowHGridLine;
|
|
|
GDFLOGFONT m_fontStandard;
|
|
|
DOUBLE m_dUnitLength;
|
|
|
bool m_bAutoFont;
|
|
|
|
|
|
GDFLOGFONT m_fontPlot;
|
|
|
};
|
|
|
|
|
|
}//namespace
|
|
|
|
|
|
|
|
|
|
|
|
#endif // ChartBaseObject_h__
|