Version: 0.6.0
categorysimpledataset.h
1 // Name: categorysimpledataset.h
3 // Purpose: category simple dataset declarations
4 // Author: Moskvichev Andrey V.
5 // Created: 2009/11/26
6 // Copyright: (c) 2009 Moskvichev Andrey V.
7 // Licence: wxWidgets licence
9 
10 #ifndef CATEGORYSIMPLEDATASET_H_
11 #define CATEGORYSIMPLEDATASET_H_
12 
13 #include <wx/category/categorydataset.h>
14 
15 #include <wx/dynarray.h>
16 
20 class WXDLLIMPEXP_FREECHART CategorySerie
21 {
22 public:
29  CategorySerie(const wxString &name, double *values, size_t count);
30  virtual ~CategorySerie();
31 
36  const wxString &GetName();
37 
43  double GetValue(size_t index);
44 
45 private:
46  wxString m_name;
47  size_t m_count;
48  double *m_values;
49 };
50 
51 WX_DECLARE_USER_EXPORTED_OBJARRAY(CategorySerie *, CategorySerieArray, WXDLLIMPEXP_FREECHART);
52 
58 class WXDLLIMPEXP_FREECHART CategorySimpleDataset : public CategoryDataset
59 {
60  DECLARE_CLASS(CategorySimpleDataset)
61 public:
67  CategorySimpleDataset(wxString *names, size_t count);
68  virtual ~CategorySimpleDataset();
69 
76  void AddSerie(const wxString &name, double *values, size_t count);
77 
82  void AddSerie(CategorySerie *serie);
83 
84  //
85  // CategoryDataset
86  //
87  virtual double GetValue(size_t index, size_t serie);
88 
89  virtual size_t GetSerieCount();
90 
91  virtual wxString GetName(size_t index);
92 
93  virtual size_t GetCount();
94 
95  virtual wxString GetSerieName(size_t serie);
96 
97 private:
98  wxArrayString m_names;
99  CategorySerieArray m_series;
100 };
101 
102 #endif /* CATEGORYSIMPLEDATASET_H_ */
Definition: categorydataset.h:19
virtual size_t GetCount()=0
virtual size_t GetSerieCount()=0
virtual double GetValue(size_t index, size_t serie)=0
Definition: categorysimpledataset.h:58
virtual wxString GetName(size_t index)=0
Definition: categorysimpledataset.h:20
virtual wxString GetSerieName(size_t serie)=0