wxFreeChart
categorydataset.h
1 // Name: categorydataset.h
3 // Purpose: category dataset declarations
4 // Author: Moskvichev Andrey V.
5 // Created: 2008/11/07
6 // Copyright: (c) 2008-2010 Moskvichev Andrey V.
7 // Licence: wxWidgets licence
9 
10 #ifndef CATEGORYDATASET_H_
11 #define CATEGORYDATASET_H_
12 
13 #include <wx/dataset.h>
14 #include <wx/bars/barrenderer.h>
15 
19 class WXDLLIMPEXP_FREECHART CategoryDataset : public XYDataset
20 {
21  DECLARE_CLASS(XYDataset)
22 public:
24  virtual ~CategoryDataset();
25 
31  virtual double GetValue(size_t index, size_t serie) = 0;
32 
38  virtual wxString GetName(size_t index) = 0;
39 
44  virtual size_t GetCount() = 0;
45 
46  virtual bool HasValue(size_t index, size_t serie);
47 
48  virtual double GetMinValue(bool verticalAxis);
49 
50  virtual double GetMaxValue(bool verticalAxis);
51 
52  //
53  // XYDataset
54  //
55  virtual double GetX(size_t index, size_t serie);
56 
57  virtual double GetY(size_t index, size_t serie);
58 
59  virtual size_t GetCount(size_t serie);
60 
61  BarRenderer *GetRenderer()
62  {
63  return (BarRenderer *) m_renderer;
64  }
65 
66 protected:
67  virtual bool AcceptRenderer(Renderer *r);
68 };
69 
70 #endif /*CATEGORYDATASET_H_*/
Base class for all renderers.
Definition: chartrenderer.h:21
Dataset for data values in form [category name, value].
virtual bool AcceptRenderer(Renderer *r)
Checks whether renderer is acceptable by this dataset.
Bar renderer.
Definition: barrenderer.h:140
virtual double GetX(size_t index, size_t serie)=0
Returns x value at index.
virtual double GetY(size_t index, size_t serie)=0
Returns y value at index.
virtual double GetMaxValue(bool verticalAxis)
Returns maximal value.
virtual size_t GetCount(size_t serie)=0
Returns value count in serie specified by index.
virtual double GetMinValue(bool verticalAxis)
Returns minimal value.
Base class for XY datasets.
Definition: xydataset.h:21