Version: 0.6.0
legend.h
1 // Name: legend.h
3 // Purpose: Legend 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 LEGEND_H_
11 #define LEGEND_H_
12 
13 #include <wx/wxfreechartdefs.h>
14 #include <wx/dataset.h>
15 #include <wx/areadraw.h>
16 #include <wx/category/categorydataset.h>
21 class WXDLLIMPEXP_FREECHART Legend
22 {
23 public:
27  const static wxCoord labelsSpacing;
28 
37  Legend(int vertPosition, int horizPosition,
38  AreaDraw *background = new FillAreaDraw(), int symbolTextGap = 2, int margin = 2);
39 
40  virtual ~Legend();
41 
48  void Draw(wxDC &dc, wxRect rc, DatasetArray &datasets);
49  void Draw(wxDC &dc, wxRect rc, CategoryDataset &dataset);
50 
56  {
57  return m_vertPosition;
58  }
59 
65  {
66  return m_horizPosition;
67  }
68 
73  void SetTextFont(wxFont font)
74  {
75  m_font = font;
76  }
77 
82  wxFont GetTextFont()
83  {
84  return m_font;
85  }
86 
93  wxSize GetExtent(wxDC &dc, DatasetArray &datasets);
94  wxSize GetExtent(wxDC &dc, CategoryDataset &dataset);
95 
96 private:
97  int m_vertPosition;
98  int m_horizPosition;
99 
100  wxFont m_font;
101 
102  AreaDraw *m_background;
103 
104  int m_symbolTextGap;
105  int m_margin;
106 };
107 
108 #endif /*LEGEND_H_*/
Definition: categorydataset.h:19
Definition: legend.h:21
int GetHorizPosition()
Definition: legend.h:64
static const wxCoord labelsSpacing
Definition: legend.h:27
Definition: areadraw.h:22
Definition: dataset.h:189
wxFont GetTextFont()
Definition: legend.h:82
void SetTextFont(wxFont font)
Definition: legend.h:73
int GetVertPosition()
Definition: legend.h:55
Definition: areadraw.h:55