|
wxFreeChart
|
Base class for plots that supports axes. More...
#include <axisplot.h>


Public Member Functions | |
| void | AddAxis (Axis *axis) |
| Adds axis to plot. More... | |
| void | AddDataset (Dataset *dataset) |
| Adds dataset to plot. More... | |
| void | RemoveDataset (Dataset *dataset) |
| Removes dataset from plot. More... | |
| void | RemoveDataset (size_t index) |
| Removes dataset from plot. More... | |
| void | AddObjects (Dataset *dataset, Axis *verticalAxis, Axis *horizontalAxis) |
| Adds dataset and vertical and horizontal axes to plot. More... | |
| size_t | GetDatasetCount () |
| Returns dataset count. More... | |
| Dataset * | GetDataset (size_t index) |
| Return dataset with index. More... | |
| void | LinkDataHorizontalAxis (size_t nData, size_t nAxis) |
| Links dataset with horizontal axis. More... | |
| void | LinkDataVerticalAxis (size_t nData, size_t nAxis) |
| Links dataset with vertical axis. More... | |
| Axis * | GetDatasetAxis (Dataset *dataset, size_t index, bool vertical) |
| Returns dataset axis. More... | |
| Axis * | GetDatasetAxis (Dataset *dataset, bool vertical) |
| Returns main dataset axis. More... | |
| Axis * | GetDatasetVerticalAxis (Dataset *dataset) |
| Returns main vertical dataset axis. More... | |
| Axis * | GetDatasetHorizontalAxis (Dataset *dataset) |
| Returns main horizontal dataset axis. More... | |
| Dataset * | GetAxisDataset (Axis *axis, size_t index) |
| Returns dataset, linked with axis at specified index. More... | |
| void | SetDrawGrid (bool drawGridVertical, bool drawGridHorizontal) |
| Set whether to draw grid lines. More... | |
| wxDEPRECATED_MSG ("SetDataBackground is deprecated, use SetBackground instead") void SetDataBackground(AreaDraw *dataBackground) | |
| Sets background for data area. More... | |
| void | SetLegend (Legend *legend) |
| Sets legend to plot. More... | |
| void | SetCrosshair (Crosshair *crosshair) |
| Attaches crosshair to this plot. More... | |
| bool | ToDataCoords (size_t nData, wxDC &dc, wxRect rc, wxCoord gx, wxCoord gy, double *x, double *y) |
| Translate coordinate from graphics to data space. More... | |
| virtual void | NeedRedraw (DrawObject *obj) |
| virtual void | DataChanged (wxCommandEvent &event) |
| virtual void | DatasetChanged (Dataset *dataset) |
| virtual void | AxisChanged (Axis *axis) |
| virtual void | BoundsChanged (Axis *axis) |
| virtual void | ChartMouseDown (wxPoint &pt, int key) |
Public Member Functions inherited from Plot | |
| virtual void | Draw (ChartDC &cdc, wxRect rc, PlotDrawMode mode=PLOT_DRAW_ALL) |
| Draws plot. More... | |
| virtual void | DrawNoDataMessage (wxDC &dc, wxRect rc) |
| Draws "no data" message. More... | |
| void | SetChartPanel (wxChartPanel *chartPanel) |
| wxChartPanel * | GetChartPanel () |
| Returns chart panel (GUI component, at top level) if it. | |
| void | SetBackground (AreaDraw *background) |
| Sets plot background. More... | |
| void | SetTextNoData (const wxString &textNoData) |
| Sets text message drawn, when plot has no data to draw. More... | |
Protected Member Functions | |
| virtual bool | AcceptAxis (Axis *axis)=0 |
| Checks whether axis is acceptable with this plot. More... | |
| virtual bool | AcceptDataset (Dataset *dataset)=0 |
| Checks whether dataset is acceptable with this plot. More... | |
| virtual void | DrawDatasets (wxDC &dc, wxRect rc)=0 |
| Called to draw all datasets. More... | |
| wxCoord | GetAxesExtent (wxDC &dc, AxisArray *axes) |
Protected Attributes | |
| bool | m_drawGridVertical |
| bool | m_drawGridHorizontal |
Protected Attributes inherited from Plot | |
| AreaDraw * | m_background |
Base class for plots that supports axes.
Definition at line 56 of file axisplot.h.
|
protectedpure virtual |
Checks whether axis is acceptable with this plot.
| axis | axis to be checked |
Implemented in XYPlot, OHLCPlot, BarPlot, GanttPlot, and BubblePlot.
|
protectedpure virtual |
Checks whether dataset is acceptable with this plot.
| dataset | dataset to be checked |
Implemented in XYPlot, OHLCPlot, BarPlot, GanttPlot, and BubblePlot.
| void AxisPlot::AddAxis | ( | Axis * | axis | ) |
Adds axis to plot.
| axis | axis to be added |
| void AxisPlot::AddDataset | ( | Dataset * | dataset | ) |
Adds dataset to plot.
| dataset | dataset to be added |
Adds dataset and vertical and horizontal axes to plot.
And links it all together.
| dataset | dataset to be added |
| verticalAxis | vertical axis to be added |
| horizontalAxis | horizontal axis to be added |
|
protectedpure virtual |
Called to draw all datasets.
| dc | device context |
| rc | rectangle where to draw |
Implemented in XYPlot, OHLCPlot, BarPlot, GanttPlot, and BubblePlot.
Returns dataset, linked with axis at specified index.
| axis | axis |
| index | dataset index |
Definition at line 172 of file axisplot.h.
References Plot::ChartPanelChanged(), Plot::DrawBackground(), Plot::DrawData(), Axis::GetDataset(), and Plot::HasData().
| Dataset* AxisPlot::GetDataset | ( | size_t | index | ) |
Return dataset with index.
| index | index of dataset |
Returns dataset axis.
| dataset | dataset |
| index | axis index, 0 - for main axis |
| vertical | true if you want to get vertical axis, false - horizontal |
Returns main dataset axis.
NOTE: main axis is the first axis linked with dataset. Main axis is used to scale dataset values.
| dataset | dataset |
| vertical | true if you want to get vertical axis, false - horizontal |
| size_t AxisPlot::GetDatasetCount | ( | ) |
Returns dataset count.
Returns main horizontal dataset axis.
NOTE: main axis is the first axis linked with dataset. Main axis is used to scale dataset values.
| dataset | dataset |
Definition at line 161 of file axisplot.h.
Returns main vertical dataset axis.
NOTE: main axis is the first axis linked with dataset. Main axis is used to scale dataset values.
| dataset | dataset |
Definition at line 149 of file axisplot.h.
| void AxisPlot::LinkDataHorizontalAxis | ( | size_t | nData, |
| size_t | nAxis | ||
| ) |
Links dataset with horizontal axis.
| nData | index of dataset |
| nAxis | index of horizontal axis |
| void AxisPlot::LinkDataVerticalAxis | ( | size_t | nData, |
| size_t | nAxis | ||
| ) |
Links dataset with vertical axis.
| nData | index of dataset |
| nAxis | index of vertical axis |
| void AxisPlot::RemoveDataset | ( | Dataset * | dataset | ) |
Removes dataset from plot.
| dataset | dataset to be removed |
| void AxisPlot::RemoveDataset | ( | size_t | index | ) |
Removes dataset from plot.
| dataset | dataset index to be removed |
| void AxisPlot::SetCrosshair | ( | Crosshair * | crosshair | ) |
Attaches crosshair to this plot.
| crosshair | crosshair |
| void AxisPlot::SetDrawGrid | ( | bool | drawGridVertical, |
| bool | drawGridHorizontal | ||
| ) |
Set whether to draw grid lines.
| drawGridVertical | if true - plot will draw vertical grid lines |
| drawGridHorizontal | if true - plot will draw horizontal grid lines |
| void AxisPlot::SetLegend | ( | Legend * | legend | ) |
| bool AxisPlot::ToDataCoords | ( | size_t | nData, |
| wxDC & | dc, | ||
| wxRect | rc, | ||
| wxCoord | gx, | ||
| wxCoord | gy, | ||
| double * | x, | ||
| double * | y | ||
| ) |
Translate coordinate from graphics to data space.
| nData | number of dataset |
| dc | device context |
| rc | plot rectangle |
| gx | x coordinate in graphics space |
| gy | y coordinate in graphics space |
| x | output for x coordinate in data space |
| y | output for y coordinate in data space |
| AxisPlot::wxDEPRECATED_MSG | ( | "SetDataBackground is | deprecated, |
| use SetBackground instead" | |||
| ) |
Sets background for data area.
This function is deprecated, use SetPlotAreaBackground instead.
| dataBackground | background for data area |
1.8.11