Version: 0.6.0
ohlcdataset.h
1 // Name: ohlcdataset.h
3 // Purpose: OHLC datasets base class declaration.
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 OHLCDATASET_H_
11 #define OHLCDATASET_H_
12 
13 #include <wx/xy/xydataset.h>
14 #include <wx/ohlc/ohlcrenderer.h>
15 
16 struct OHLCItem
17 {
18  double open;
19  double high;
20  double low;
21  double close;
22 
23  int volume;
24 
25  time_t date;
26 };
27 
31 class WXDLLIMPEXP_FREECHART OHLCDataset : public Dataset, public DateTimeDataset
32 {
33  DECLARE_CLASS(OHLCDataset)
34 public:
35  OHLCDataset();
36  virtual ~OHLCDataset();
37 
38  OHLCRenderer *GetRenderer()
39  {
40  return (OHLCRenderer *) m_renderer;
41  }
42 
47  void SetSerieName(const wxString &serieName)
48  {
49  m_serieName = serieName;
51  }
52 
57  virtual OHLCItem *GetItem(size_t index) = 0;
58 
63  virtual size_t GetCount() = 0;
64 
65  //
66  // Dataset
67  //
68  virtual double GetMinValue(bool verticalAxis);
69 
70  virtual double GetMaxValue(bool verticalAxis);
71 
72  virtual size_t GetSerieCount();
73 
74  virtual wxString GetSerieName(size_t serie);
75 
76  virtual size_t GetCount(size_t serie);
77 
78  virtual DateTimeDataset *AsDateTimeDataset();
79 
80  //
81  // DateDataset
82  //
83  virtual time_t GetDate(size_t index);
84 
85 protected:
86  virtual bool AcceptRenderer(Renderer *r);
87 
88  wxString m_serieName;
89 };
90 
91 #endif /*OHLCDATASET_H_*/
void DatasetChanged()
Definition: dataset.cpp:78
Definition: chartrenderer.h:21
virtual double GetMinValue(bool vertical)=0
virtual size_t GetSerieCount()=0
Definition: ohlcrenderer.h:28
virtual double GetMaxValue(bool vertical)=0
Definition: ohlcdataset.h:31
void SetSerieName(const wxString &serieName)
Definition: ohlcdataset.h:47
Definition: dataset.h:167
Definition: dataset.h:50
virtual time_t GetDate(size_t index)=0
virtual bool AcceptRenderer(Renderer *r)=0
virtual size_t GetCount(size_t serie)=0
virtual wxString GetSerieName(size_t serie)=0
Definition: ohlcdataset.h:16