Version: 0.6.0
xyhistorenderer.h
1 // Name: xyhistorenderer.h
3 // Purpose: xy histogram renderer 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 XYHISTORENDERER_H_
11 #define XYHISTORENDERER_H_
12 
13 #include <wx/xy/xyrenderer.h>
14 #include <wx/areadraw.h>
15 
19 class WXDLLIMPEXP_FREECHART XYHistoRenderer : public XYRenderer, public DrawObserver
20 {
21  DECLARE_CLASS(XYHistoRenderer)
22 public:
28  XYHistoRenderer(int barWidth = 10, bool vertical = true);
29  virtual ~XYHistoRenderer();
30 
31  virtual void Draw(wxDC &dc, wxRect rc, Axis *horizAxis, Axis *vertAxis, XYDataset *dataset);
32 
39  void SetBarArea(size_t serie, AreaDraw *barArea);
40 
46  AreaDraw *GetBarArea(size_t serie);
47 
48  //
49  // DrawObserver
50  //
51  virtual void NeedRedraw(DrawObject *obj);
52 
53 private:
54  void DrawBar(int serie, wxDC &dc, wxRect rcData, wxCoord x, wxCoord y);
55 
56  int m_barWidth;
57  bool m_vertical;
58 
59  wxCoord m_serieShift;
60 
61  AreaDrawCollection m_barAreas;
62 };
63 
64 #endif /*XYHISTORENDERER_H_*/
Definition: areadraw.h:22
Definition: axis.h:62
Definition: areadraw.h:182
Definition: drawobject.h:23
Definition: drawobject.h:45
Definition: xyhistorenderer.h:19
virtual void NeedRedraw(DrawObject *obj)=0
virtual void Draw(wxDC &dc, wxRect rc, Axis *horizAxis, Axis *vertAxis, XYDataset *dataset)=0
Definition: xydataset.h:21
Definition: xyrenderer.h:20