wxFreeChart
dateaxis.h
1 // Name: dateaxis.h
3 // Purpose: Date/time axis declaration
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 DATEAXIS_H_
11 #define DATEAXIS_H_
12 
13 #include <wx/axis/labelaxis.h>
14 
15 
21 class WXDLLIMPEXP_FREECHART DateAxis : public LabelAxis
22 {
23  DECLARE_CLASS(DateAxis)
24 public:
25  DateAxis(AXIS_LOCATION location);
26  virtual ~DateAxis();
27 
28  virtual bool UpdateBounds() wxOVERRIDE;
29 
34  void SetDateFormat(const wxString &dateFormat)
35  {
36  m_dateFormat = dateFormat;
37  }
38 
39  virtual void GetDataBounds(double &minValue, double &maxValue) const;
40 
41 protected:
42  virtual bool AcceptDataset(Dataset *dataset);
43 
44  //
45  // LabelAxis
46  //
47  virtual double GetValue(size_t step);
48 
49  virtual void GetLabel(size_t step, wxString &label);
50 
51  virtual bool IsEnd(size_t step);
52 
53  virtual wxSize GetLongestLabelExtent(wxDC &dc);
54 
55 private:
56  size_t m_dateCount;
57 
58  wxString m_dateFormat;
59 };
60 
61 #endif /*DATEAXIS_H_*/
void SetDateFormat(const wxString &dateFormat)
Sets date format for date labels.
Definition: dateaxis.h:34
An axis for displaying date/time values.
Definition: dateaxis.h:21
Base class for axes for displaying data labels.
Definition: labelaxis.h:29
virtual void GetDataBounds(double &minValue, double &maxValue) const =0
Returns data bounds.
virtual void GetLabel(size_t step, wxString &label)=0
Returns label on step.
virtual bool UpdateBounds()=0
Performs axis bounds update after dataset/s change.
virtual bool IsEnd(size_t step)=0
Check whether step is last.
Base class for all datasets (XYDatasets, XYZDatasets, CategoryDatasets, OHLCDatasets, etc).
Definition: dataset.h:39
virtual bool AcceptDataset(Dataset *dataset)=0
Checks whether dataset can be accepted by this axis.
virtual double GetValue(size_t step)=0
Returns value on step.