#include <axisplot.h>
Public Member Functions | |
void | AddAxis (Axis *axis) |
void | AddDataset (Dataset *dataset) |
void | RemoveDataset (Dataset *dataset) |
void | RemoveDataset (size_t index) |
void | AddObjects (Dataset *dataset, Axis *verticalAxis, Axis *horizontalAxis) |
size_t | GetDatasetCount () |
Dataset * | GetDataset (size_t index) |
void | LinkDataHorizontalAxis (size_t nData, size_t nAxis) |
void | LinkDataVerticalAxis (size_t nData, size_t nAxis) |
Axis * | GetDatasetAxis (Dataset *dataset, size_t index, bool vertical) |
Axis * | GetDatasetAxis (Dataset *dataset, bool vertical) |
Axis * | GetDatasetVerticalAxis (Dataset *dataset) |
Axis * | GetDatasetHorizontalAxis (Dataset *dataset) |
Dataset * | GetAxisDataset (Axis *axis, size_t index) |
void | SetDrawGrid (bool drawGridVertical, bool drawGridHorizontal) |
void | SetDataBackground (AreaDraw *dataBackground) |
void | SetLegend (Legend *legend) |
void | SetCrosshair (Crosshair *crosshair) |
bool | ToDataCoords (size_t nData, wxDC &dc, wxRect rc, wxCoord gx, wxCoord gy, double *x, double *y) |
virtual void | NeedRedraw (DrawObject *obj) |
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 (wxDC &dc, wxRect rc) |
virtual void | DrawNoDataMessage (wxDC &dc, wxRect rc) |
void | SetChartPanel (wxChartPanel *chartPanel) |
wxChartPanel * | GetChartPanel () |
void | SetBackground (AreaDraw *background) |
void | SetTextNoData (const wxString &textNoData) |
Public Member Functions inherited from Observable< PlotObserver > | |
void | AddObserver (PlotObserver *_observer) |
void | RemoveObserver (PlotObserver *_observer) |
Public Member Functions inherited from ChartPanelObserver | |
virtual void | ChartEnterWindow () |
virtual void | ChartMouseUp (wxPoint &pt, int key) |
virtual void | ChartMouseMove (wxPoint &pt) |
virtual void | ChartMouseDrag (wxPoint &pt) |
virtual void | ChartMouseWheel (int rotation) |
Protected Member Functions | |
virtual bool | AcceptAxis (Axis *axis)=0 |
virtual bool | AcceptDataset (Dataset *dataset)=0 |
virtual void | DrawDatasets (wxDC &dc, wxRect rc)=0 |
wxCoord | GetAxesExtent (wxDC &dc, AxisArray *axes) |
Protected Member Functions inherited from Plot | |
FIRE_WITH_THIS (PlotNeedRedraw) | |
Additional Inherited Members | |
Public Types inherited from Observable< PlotObserver > | |
typedef PlotObserver | Observer |
Public Attributes inherited from Observable< PlotObserver > | |
std::vector< PlotObserver * > ::iterator | OIt |
Protected Attributes inherited from Observable< PlotObserver > | |
std::vector< PlotObserver * > | observers |
Base class for plots that supports axes.
|
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 |
|
virtual |
|
virtual |
Called when axis bounds are changed.
axis | axis that bounds are changed |
Implements AxisObserver.
|
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 |
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 |
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 |
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 |
|
virtual |
Called when object is need to be redrawed.
obj | object that need to be redrawed |
Implements DrawObserver.
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::SetDataBackground | ( | AreaDraw * | dataBackground | ) |
Sets background for data area.
dataBackground | background for data area |
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 | ) |
Sets legend to plot. Plot take ownership of legend.
legend | new legend for plot |
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 |