wxFreeChart
categoryaxis.h
1 // Name: categoryaxis.h
3 // Purpose: category axis declarations
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 CATEGORYAXIS_H_
11 #define CATEGORYAXIS_H_
12 
13 #include <wx/axis/labelaxis.h>
14 
18 class WXDLLIMPEXP_FREECHART CategoryAxis : public LabelAxis
19 {
20  DECLARE_CLASS(CategoryAxis)
21 public:
22  CategoryAxis(AXIS_LOCATION location);
23  virtual ~CategoryAxis();
24 
25  virtual bool UpdateBounds() wxOVERRIDE;
26 
27  virtual void GetDataBounds(double &minValue, double &maxValue) const;
28 
29 protected:
30  virtual bool AcceptDataset(Dataset *dataset);
31 
32  //
33  // LabelAxis
34  //
35  virtual double GetValue(size_t step);
36 
37  virtual void GetLabel(size_t step, wxString &label);
38 
39  virtual bool IsEnd(size_t step);
40 
41  virtual wxSize GetLongestLabelExtent(wxDC &dc);
42 
43 private:
44  size_t m_categoryCount;
45  wxString m_longestCategory;
46 };
47 
48 #endif /*CATEGORYAXIS_H_*/
An axis for displaying category names.
Definition: categoryaxis.h:18
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.