00001
00002
00003
00004
00005
00006
00007
00009
00010 #ifndef XYLINERENDERER_H_
00011 #define XYLINERENDERER_H_
00012
00013 #include <wx/xy/xyrenderer.h>
00014 #include <wx/art.h>
00015
00016 class WXDLLIMPEXP_FREECHART XYLineRendererBase : public XYRenderer
00017 {
00018 DECLARE_CLASS(XYLineRendererBase)
00019 public:
00020 XYLineRendererBase(int defaultWidth = 1, int defaultStyle = wxSOLID);
00021 virtual ~XYLineRendererBase();
00022
00028 virtual void SetSerieColour(size_t serie, wxColour *colour);
00029
00035 virtual wxColour GetSerieColour(size_t serie);
00036
00042 void SetSeriePen(size_t serie, wxPen *pen);
00043
00049 wxPen *GetSeriePen(size_t serie);
00050
00051 private:
00052 PenMap m_seriePens;
00053
00054 int m_defaultPenWidth;
00055 int m_defaultPenStyle;
00056 };
00057
00061 class WXDLLIMPEXP_FREECHART XYLineRenderer : public XYLineRendererBase
00062 {
00063 DECLARE_CLASS(XYLineRenderer)
00064 public:
00072 XYLineRenderer(bool drawSymbols = false, bool drawLines = true, int defaultWidth = 1, int defaultStyle = wxSOLID);
00073 virtual ~XYLineRenderer();
00074
00075
00076
00077
00078 virtual void DrawLegendSymbol(wxDC &dc, wxRect rcSymbol, size_t serie);
00079
00080 virtual void Draw(wxDC &dc, wxRect rc, Axis *horizAxis, Axis *vertAxis, XYDataset *dataset);
00081
00082 private:
00083 void DrawSegment(wxDC &dc, size_t serie, wxCoord x0, wxCoord y0, wxCoord x1, wxCoord y1);
00084
00085 bool m_drawSymbols;
00086 bool m_drawLines;
00087 };
00088
00094 class WXDLLIMPEXP_FREECHART XYLineStepRenderer : public XYLineRendererBase
00095 {
00096 DECLARE_CLASS(XYLineStepRenderer)
00097 public:
00098 XYLineStepRenderer(int defaultWidth = 1, int defaultStyle = wxSOLID);
00099 virtual ~XYLineStepRenderer();
00100
00101 virtual void Draw(wxDC &dc, wxRect rc, Axis *horizAxis, Axis *vertAxis, XYDataset *dataset);
00102
00103
00104
00105
00106 virtual void DrawLegendSymbol(wxDC &dc, wxRect rcSymbol, size_t serie);
00107
00108 private:
00109 size_t GetFirstVisibleIndex(Axis *horizAxis, Axis *vertAxis, XYDataset *dataset, size_t serie);
00110 };
00111
00112 #endif