10 #ifndef COMPDATEAXIS_H_ 11 #define COMPDATEAXIS_H_ 13 #include <wx/axis/axis.h> 14 #include <wx/areadraw.h> 16 #include <wx/dynarray.h> 18 WX_DECLARE_USER_EXPORTED_OBJARRAY(wxDateSpan, wxDateSpanArray, WXDLLIMPEXP_FREECHART);
19 WX_DECLARE_USER_EXPORTED_OBJARRAY(wxTimeSpan, wxTimeSpanArray, WXDLLIMPEXP_FREECHART);
33 virtual void Draw(wxDC &dc, wxRect rc);
41 virtual void GetDataBounds(
double &minValue,
double &maxValue)
const;
43 virtual wxCoord
ToGraphics(wxDC &dc,
int minCoord,
int gRange,
double value);
45 virtual double ToData(wxDC &dc,
int minCoord,
int gRange, wxCoord g);
50 void AddInterval(
const wxDateSpan &interval);
52 void AddInterval(
const wxTimeSpan &interval);
61 wxREPLACE(m_spanDraw, spanDraw);
68 void DrawSpan(wxDC &dc, wxRect rcAxis,
int spanNum, wxString spanLabel,
double start,
double end);
70 wxString GetSpanLabel(wxDateTime date, wxDateSpan span);
72 wxCoord GetSpanExtent(wxDC &dc);
74 bool GetWindowDateBounds(wxDateTime &date0, wxDateTime &date1);
76 double DateToDataCoord(wxDateTime &date);
78 bool GetFirstDate(wxDateTime &date);
79 bool GetLastDate(wxDateTime &date);
81 bool GetFirstLastDate(wxDateTime &firstDate, wxDateTime &lastDate);
83 bool GetMinSpan(wxDateSpan &span);
90 wxColour m_labelColour;
92 wxCoord m_minLabelGap;
93 wxCoord m_labelMargin;
96 wxDateSpanArray m_dateSpans;
virtual wxCoord ToGraphics(wxDC &dc, int minCoord, int gRange, double value)
Transforms coordinate from data space to graphics space.
virtual wxCoord GetExtent(wxDC &dc)=0
Used to determine minimal size needed to draw axis contents, minimal width for vertical axes...
virtual void Draw(wxDC &dc, wxRect rc)=0
Performs axis drawing.
void SetSpanDraw(AreaDraw *spanDraw)
Sets area draw to draw spans background.
virtual void GetDataBounds(double &minValue, double &maxValue) const =0
Returns data bounds.
virtual bool UpdateBounds()=0
Performs axis bounds update after dataset/s change.
Base class for all datasets (XYDatasets, XYZDatasets, CategoryDatasets, OHLCDatasets, etc).
Base class for drawing area background.
virtual bool AcceptDataset(Dataset *dataset)=0
Checks whether dataset can be accepted by this axis.
virtual void DrawGridLines(wxDC &dc, wxRect rcData)=0
Draws grid lines for axis.
virtual double ToData(wxDC &dc, int minCoord, int gRange, wxCoord g)
Transforms coordinate from graphics space to data space.