wxFreeChart
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 bool UpdateBounds() wxOVERRIDE;
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 wxCoord ToGraphics(wxDC &dc, int minCoord, int gRange, double value)
Transforms coordinate from data space to graphics space.
virtual void GetLabel(size_t step, wxString &label)
Returns label on step.
virtual bool UpdateBounds()
Performs axis bounds update after dataset/s change.
An axis for displaying and logarithmically scaling numerical data.
virtual double GetValue(size_t step)
Returns value on step.
virtual double BoundValue(double value)
Returns nearest boundary value.
virtual bool IsVisible(double value)
Checks whether data value is visible.
Base class for all datasets (XYDatasets, XYZDatasets, CategoryDatasets, OHLCDatasets, etc).
Definition: dataset.h:39
An axis for displaying and scaling numerical data.
Definition: numberaxis.h:18
virtual double ToData(wxDC &dc, int minCoord, int gRange, wxCoord g)
Transforms coordinate from graphics space to data space.