1 /////////////////////////////////////////////////////////////////////////////
2 // Name:        chart.h
3 // Purpose:     wxChart
4 // Author:      Paolo Gava
5 // Modified by:
6 // Created:
7 // Copyright:   (C) 2006, Paolo Gava
8 // RCS-ID:      $Id: chart.h 7947 2012-04-28 10:01:45Z mortenmacfly $
9 // Licence:     wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
11 
12 #if !defined( __CHART_H__ )
13 #define __CHART_H__
14 
15 //----------------------------------------------------------------------------
16 // Headers
17 //----------------------------------------------------------------------------
18 #if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
19 #pragma interface "chart.h"
20 #endif
21 
22 // For compilers that support precompilation, includes "wx.h".
23 #include <wx/wxprec.h>
24 
25 #ifdef __BORLANDC__
26 #pragma hdrstop
27 #endif
28 
29 #ifndef WX_PRECOMP
30     #include <wx/dynarray.h>
31 #endif
32 
33 #include "wx/chartpoints.h"
34 
35 // External Classes
36 //-----------------
37 class wxChartSizes;
38 
39 //----------------------------------------------------------------------------
40 // Declare Array/List of Points
41 //----------------------------------------------------------------------------
42 WX_DECLARE_OBJARRAY(wxChartPoints*, ListChartPoints);
43 
44 //+++-S-cd-------------------------------------------------------------------
45 //	NAME:		wxChart
46 //	DESC:
47 //	INTERFACE:
48 //
49 //----------------------------------------------------------------------E-+++
50 /* C::B begin */
51 class WXDLLIMPEXP_CHART wxChart
52 /* C::B end */
53 {
54 public:
55 	wxChart();
56 	virtual ~wxChart();
57 
58 	// ChartPoints utility
59 	//--------------------
60 	void Add(wxChartPoints* cp);
61 	void Clear();
62 
63 	// Get statistics
64 	//---------------
65 	ChartValue GetMaxX() const;
66 	ChartValue GetMinX() const;
67 	ChartValue GetMaxY() const;
68 	ChartValue GetMinY() const;
69 	int GetNumBarPoints() const;
70 	int GetNumBar3DPoints() const;
71 
72 	// Set zoom
73 	//-------------
74 	void SetZoom(double z);
75     double GetZoom() const;
76 
77 	// Set sizes for drawing
78 	//----------------------
79 	void SetSizes(wxChartSizes *sizes);
80     wxChartSizes* GetSizes() const;
81 
82 	// Draw chart
83 	//-----------
84 	virtual void Draw(CHART_HPAINT hp, CHART_HRECT hr);
85 
86 private:
87 	ListChartPoints m_LCP;
88 };
89 
90 #endif // __CHART_H__
91