00001
00002
00003
00004
00005
00006
00007
00009
00010 #ifndef LEGEND_H_
00011 #define LEGEND_H_
00012
00013 #include <wx/wxfreechartdefs.h>
00014 #include <wx/dataset.h>
00015 #include <wx/areadraw.h>
00016
00021 class WXDLLIMPEXP_FREECHART Legend
00022 {
00023 public:
00027 const static wxCoord labelsSpacing;
00028
00037 Legend(int vertPosition, int horizPosition, AreaDraw *background = new FillAreaDraw(), int symbolTextGap = 2, int margin = 2);
00038
00039 virtual ~Legend();
00040
00047 void Draw(wxDC &dc, wxRect rc, DatasetArray &datasets);
00048
00053 int GetVertPosition()
00054 {
00055 return m_vertPosition;
00056 }
00057
00062 int GetHorizPosition()
00063 {
00064 return m_horizPosition;
00065 }
00066
00071 void SetTextFont(wxFont font)
00072 {
00073 m_font = font;
00074 }
00075
00080 wxFont GetTextFont()
00081 {
00082 return m_font;
00083 }
00084
00091 wxSize GetExtent(wxDC &dc, DatasetArray &datasets);
00092
00093 private:
00094 int m_vertPosition;
00095 int m_horizPosition;
00096
00097 wxFont m_font;
00098
00099 AreaDraw *m_background;
00100
00101 int m_symbolTextGap;
00102 int m_margin;
00103 };
00104
00105 #endif