Version: 0.6.0
logarithmicnumberaxis.h
1 // Name: logarithmicnumberaxis.h
3 // Purpose: label axis implementation
4 // Author: Andreas Kuechler
5 // Created: 2008/11/07
6 // Copyright: (c) 2010 Andreas Kuechler
7 // Licence: wxWidgets licence
9 
10 #ifndef LOGARITHMICNUMBERAXIS_H_INCLUDED
11 #define LOGARITHMICNUMBERAXIS_H_INCLUDED
12 
13 #include <wx/axis/numberaxis.h>
14 
18 class WXDLLIMPEXP_FREECHART LogarithmicNumberAxis : public NumberAxis
19 {
20  DECLARE_CLASS(LogarithmicNumberAxis);
21 public:
22  LogarithmicNumberAxis(AXIS_LOCATION location);
23  virtual ~LogarithmicNumberAxis();
24 
25  virtual void UpdateBounds();
26  virtual double BoundValue(double value);
27  virtual bool IsVisible(double value);
28 
33  void SetLogBase(double logBase);
34 
38  void EnableLongLabelExponent(bool enable = true);
39 
43  virtual wxCoord ToGraphics(wxDC &dc, int minCoord, int gRange, double value);
44 
48  virtual double ToData(wxDC &dc, int minCoord, int gRange, wxCoord g);
49 
50 protected:
51  virtual void GetLabel(size_t step, wxString& label);
52  virtual double GetValue(size_t step);
53 
54  double GetMinValue(Dataset* dataset);
55  double GetMaxValue(Dataset* dataset);
56 
57 private:
58  bool m_longExponent;
59 
60  double m_logBase;
61 };
62 
63 #endif // LOGARITHMICNUMBERAXIS_H_INCLUDED
virtual bool IsVisible(double value)
Definition: axis.cpp:65
virtual double BoundValue(double value)
Definition: axis.cpp:89
virtual wxCoord ToGraphics(wxDC &dc, int minCoord, int gRange, double value)
Definition: axis.cpp:111
virtual double GetValue(size_t step)
Definition: numberaxis.cpp:165
virtual void UpdateBounds()
Definition: numberaxis.cpp:87
virtual double ToData(wxDC &dc, int minCoord, int gRange, wxCoord g)
Definition: axis.cpp:130
Definition: dataset.h:50
Definition: logarithmicnumberaxis.h:18
virtual void GetLabel(size_t step, wxString &label)
Definition: numberaxis.cpp:170
Definition: numberaxis.h:18