14 #include <wx/axis/axis.h> 16 #include <wx/areadraw.h> 17 #include <wx/legend.h> 18 #include <wx/marker.h> 19 #include <wx/crosshair.h> 20 #include <wx/chartpanel.h> 22 #include <wx/dynarray.h> 39 m_dataset = o.m_dataset;
51 WX_DECLARE_USER_EXPORTED_OBJARRAY(
DataAxisLink, DataAxisLinkArray, WXDLLIMPEXP_FREECHART);
66 void AddAxis(
Axis *axis);
72 void AddDataset(
Dataset *dataset);
78 void RemoveDataset(
Dataset *dataset);
84 void RemoveDataset(
size_t index);
93 void AddObjects(
Dataset *dataset,
Axis *verticalAxis,
Axis *horizontalAxis);
99 size_t GetDatasetCount();
106 Dataset *GetDataset(
size_t index);
113 void LinkDataHorizontalAxis(
size_t nData,
size_t nAxis);
120 void LinkDataVerticalAxis(
size_t nData,
size_t nAxis);
129 Axis *GetDatasetAxis(
Dataset *dataset,
size_t index,
bool vertical);
140 Axis *GetDatasetAxis(
Dataset *dataset,
bool vertical);
151 return GetDatasetAxis(dataset,
true);
163 return GetDatasetAxis(dataset,
false);
182 void SetDrawGrid(
bool drawGridVertical,
bool drawGridHorizontal);
189 wxDEPRECATED_MSG(
"SetDataBackground is deprecated, use SetBackground instead")
190 void SetDataBackground(
AreaDraw *dataBackground);
196 void SetLegend(
Legend *legend);
215 bool ToDataCoords(
size_t nData, wxDC &dc, wxRect rc, wxCoord gx, wxCoord gy,
double *x,
double *y);
222 virtual void DataChanged(wxCommandEvent& event);
227 virtual void DatasetChanged(
Dataset *dataset);
232 virtual void AxisChanged(
Axis *axis);
234 virtual void BoundsChanged(
Axis *axis);
239 virtual void ChartMouseDown(wxPoint &pt,
int key);
251 virtual bool AcceptAxis(
Axis *axis) = 0;
258 virtual bool AcceptDataset(
Dataset *dataset) = 0;
265 virtual void DrawDatasets(wxDC &dc, wxRect rc) = 0;
267 wxCoord GetAxesExtent(wxDC &dc, AxisArray *axes);
269 bool m_drawGridVertical;
270 bool m_drawGridHorizontal;
282 bool UpdateAxis(
Dataset *dataset = NULL);
295 void CalcDataArea(wxDC &dc, wxRect rc, wxRect &rcData, wxRect &rcLegend);
303 void DrawAxes(wxDC &dc, wxRect &rc, wxRect rcData);
312 void DrawAxesArray(wxDC &dc, wxRect rc, AxisArray *axes,
bool vertical);
320 void DrawGridLines(wxDC &dc, wxRect rcData);
327 void DrawMarkers(wxDC &dc, wxRect rcData);
341 void DrawLegend(wxDC &dc, wxRect rcLegend);
343 AxisArray m_leftAxes;
344 AxisArray m_rightAxes;
346 AxisArray m_bottomAxes;
348 AxisArray m_horizontalAxes;
349 AxisArray m_verticalAxes;
351 DataAxisLinkArray m_links;
356 wxCoord m_legendPlotGap;
362 wxBitmap m_plotBackgroundBitmap;
363 wxBitmap m_dataOverlayBitmap;
365 bool m_redrawDataArea;
Internal class, don't use in your applications.
Dataset * GetDataset(size_t index)
Returns dataset, linked with this axis at specified index.
Base class for all plots.
Axis * GetDatasetHorizontalAxis(Dataset *dataset)
Returns main horizontal dataset axis.
Base class for objects drawn on chart or perform drawing of another objects (like renderers...
ChartPanel is wxWidgets panel for displaying chart.
DC that includes a flag to indicate antialiased drawing should be used where appropriate.
virtual void DrawBackground(ChartDC &cdc, wxRect rc)=0
Draw the plot's static items (e.g.
Dataset * GetAxisDataset(Axis *axis, size_t index)
Returns dataset, linked with axis at specified index.
virtual bool HasData()=0
Checks whether plot has data.
virtual void ChartPanelChanged(wxChartPanel *oldPanel, wxChartPanel *newPanel)
Called when chart panel is changed.
Base class for all datasets (XYDatasets, XYZDatasets, CategoryDatasets, OHLCDatasets, etc).
Base class for plots that supports axes.
Base class for drawing area background.
Axis * GetDatasetVerticalAxis(Dataset *dataset)
Returns main vertical dataset axis.
virtual void DrawData(ChartDC &cdc, wxRect rc)=0
Draw the plot data, i.e.