1
/////////////////////////////////////////////////////////////////////////////
7
// Copyright: (C) 2006, Paolo Gava
8
// RCS-ID: $Id: chartpoints.h 4669 2007-11-24 14:54:50Z killerbot $
9
// Licence: wxWindows licence
10
/////////////////////////////////////////////////////////////////////////////
12
#if !defined( __CHARTPOINTS_H__ )
13
#define __CHARTPOINTS_H__
15
//----------------------------------------------------------------------------
17
//----------------------------------------------------------------------------
19
#include "wx/charttypes.h"
20
#include "wx/chartpointstypes.h"
22
//+++-S-te-------------------------------------------------------------------
23
// NAME: wxDISPLAY_LABEL
24
// DESC: Specify how to display Label on Chart.
26
//----------------------------------------------------------------------E-+++
30
XVALUE, // display x value
31
YVALUE, // display y value
32
NAME // display custom label
36
//+++-S-cd-------------------------------------------------------------------
37
// NAME: wxChartPoints
38
// DESC: Generic chart points description
41
//----------------------------------------------------------------------E-+++
42
class WXDLLIMPEXP_CHART wxChartPoints
46
wxChartPoints(wxChartPointsTypes t) : m_Type(t) {};
47
virtual ~wxChartPoints() {};
49
// Draw the series of points
50
// pure virtual function
51
//--------------------------
52
virtual void Draw(CHART_HPAINT hp, CHART_HRECT hr) = 0;
54
// Get n-th point information
55
// pure virtual functions
56
//---------------------------
57
virtual ChartValue GetXVal(int n) const = 0;
58
virtual ChartValue GetYVal(int n) const = 0;
59
virtual wxString GetName(int n) const = 0;
60
virtual ChartColor GetColor(int n) const = 0;
63
// pure virtual functions
64
//-----------------------
65
virtual int GetCount() const = 0;
66
virtual ChartValue GetMaxX() const = 0;
67
virtual ChartValue GetMaxY() const = 0;
68
virtual ChartValue GetMinX() const = 0;
69
virtual ChartValue GetMinY() const = 0;
72
// pure virtual functions
73
//-----------------------
74
virtual void SetZoom(double z) = 0;
75
virtual double GetZoom() = 0;
77
// Set sizes for drawing
78
// pure virtual functions
79
//-----------------------
80
virtual void SetSizes(ChartSizes sizes) = 0;
81
virtual const ChartSizes& GetSizes() const = 0;
84
// pure virtual functions
85
//-----------------------
86
virtual ChartColor GetColor() const = 0;
87
virtual void SetColor(ChartColor c) = 0;
90
// pure virtual functions
91
//-----------------------
92
virtual wxString GetName() const = 0;
93
virtual void SetName(wxString name) = 0;
97
virtual void Add(wxString name, ChartValue x, ChartValue y) = 0;
98
virtual void Add(wxString name, ChartValue x, ChartValue y,
101
// Set/Get Display option
102
//-----------------------
103
virtual void SetDisplayTag(wxDISPLAY_LABEL d) = 0;
104
virtual wxDISPLAY_LABEL GetDisplayTag() const = 0;
108
const wxChartPointsTypes GetType() const { return m_Type; }
112
// chart points type: bar, bar3d, ...
113
//-----------------------------------
114
const wxChartPointsTypes m_Type;
116
// copy ctor & op= NOT allow
117
//--------------------------
118
wxChartPoints(const wxChartPoints&);
119
wxChartPoints& operator=(const wxChartPoints&);
124
//+++-S-cf-------------------------------------------------------------------
127
// PARAMETERS: const wxChartPoints& c,
128
// const wxChartPointsTypes& t
130
//----------------------------------------------------------------------E-+++
131
inline bool operator==(
132
const wxChartPoints& c,
133
const wxChartPointsTypes& t
136
return ( c.GetType() == t );
139
#endif // __CHARTPOINTS_H__