wxFreeChart
multiplot.h
1 // Name: multiplot.h
3 // Purpose:
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 MULTIPLOT_H_
11 #define MULTIPLOT_H_
12 
13 #include <wx/dynarray.h>
14 #include <wx/plot.h>
15 
16 WX_DECLARE_USER_EXPORTED_OBJARRAY(Plot *, PlotArray, WXDLLIMPEXP_FREECHART);
17 
22 class WXDLLIMPEXP_FREECHART MultiPlot : public Plot
23 {
24 public:
32  MultiPlot(int rows, int cols, wxCoord horizGap, wxCoord vertGap);
33  virtual ~MultiPlot();
34 
39  void AddPlot(Plot *subPlot)
40  {
41  m_subPlots.Add(subPlot);
42  }
43 
44  //
45  // PlotObserver
46  //
47  virtual void PlotNeedRedraw(Plot *plot);
48 
49 protected:
50  virtual bool HasData();
51 
52  virtual void DrawData(ChartDC& cdc, wxRect rc);
53 
54  virtual void DrawBackground(ChartDC& cdc, wxRect rc) {}; // Does nothing in a multi plot?
55 
56 private:
57  PlotArray m_subPlots;
58 
59  int m_rows;
60  int m_cols;
61  wxCoord m_horizGap;
62  wxCoord m_vertGap;
63 };
64 
65 #endif /*MULTIPLOT_H_*/
void AddPlot(Plot *subPlot)
Add plot to this multiplot.
Definition: multiplot.h:39
Base class for all plots.
Definition: plot.h:31
DC that includes a flag to indicate antialiased drawing should be used where appropriate.
Definition: chartdc.h:18
virtual bool HasData()=0
Checks whether plot has data.
Multiplot is plot containing one or more plots, called subplots.
Definition: multiplot.h:22
virtual void DrawBackground(ChartDC &cdc, wxRect rc)
Draw the plot&#39;s static items (e.g.
Definition: multiplot.h:54
virtual void DrawData(ChartDC &cdc, wxRect rc)=0
Draw the plot data, i.e.