wxFreeChart
vectordataset.h
1 // Name: vectordataset.h
3 // Purpose: vector 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 VECTORDATASET_H_
11 #define VECTORDATASET_H_
12 
13 #include <wx/xy/xydataset.h>
14 #include <wx/dynarray.h>
15 
16 WX_DECLARE_USER_EXPORTED_OBJARRAY(double, wxDoubleArray, WXDLLIMPEXP_FREECHART);
17 
23 class WXDLLIMPEXP_FREECHART VectorDataset : public XYDataset
24 {
25 public:
31  VectorDataset();
32  virtual ~VectorDataset();
33 
34  virtual size_t GetSerieCount();
35 
36  virtual size_t GetCount(size_t serie);
37 
38  virtual wxString GetSerieName(size_t serie);
39 
40  virtual double GetX(size_t index, size_t serie);
41 
42  virtual double GetY(size_t index, size_t serie);
43 
48  void Add(double y);
49 
55  void Replace(size_t index, double y);
56 
61  void RemoveAt(size_t index);
62 
66  void Clear();
67 
68 private:
69  wxDoubleArray m_values;
70 };
71 
72 #endif /*VECTORDATASET_H_*/
virtual size_t GetSerieCount()=0
Returns serie count in this dataset.
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 size_t GetCount(size_t serie)=0
Returns value count in serie specified by index.
Base class for XY datasets.
Definition: xydataset.h:21
Vector implementation of XYDataset.
Definition: vectordataset.h:23
virtual wxString GetSerieName(size_t serie)=0
Returns serie name.