wxFreeChart
Public Member Functions | Protected Member Functions | List of all members
LabelAxis Class Referenceabstract

Base class for axes for displaying data labels. More...

#include <labelaxis.h>

Inheritance diagram for LabelAxis:
Inheritance graph
[legend]
Collaboration diagram for LabelAxis:
Collaboration graph
[legend]

Public Member Functions

 LabelAxis (AXIS_LOCATION location)
 
void SetTitle (const wxString &title)
 Sets axis title. More...
 
const wxString & GetTitle ()
 Returns axis title. More...
 
void SetTitleLocation (int location)
 Sets axis title location. More...
 
int GetTitleLocation ()
 Returns axis title location. More...
 
void SetTitleFont (wxFont &font)
 Sets axis title font. More...
 
const wxFont & GetTitleFont ()
 Returns axis title font. More...
 
void SetTitleColour (wxColour &colour)
 Sets axis title colour. More...
 
wxColour GetTitleColour ()
 Returns axis title colour. More...
 
void SetLabelPen (wxPen labelPen)
 Sets pen for label lines. More...
 
void SetLabelTextColour (wxColour labelTextColour)
 Sets colour for labels. More...
 
wxColour GetLabelTextColour ()
 Returns label colour. More...
 
void SetLabelTextFont (wxFont labelTextFont)
 Sets font for labels text. More...
 
const wxFont & GetLabelTextFont ()
 Returns label font. More...
 
void SetVerticalLabelText (bool verticalLabelText)
 Sets whether to draw labels text vertical. More...
 
bool GetVerticalLabelText ()
 Returns whether to draw labels text vertical. More...
 
 wxDEPRECATED_MSG ("Use SetMinorIntervalCount instead.") void SetMajorLabelSteps(size_t step)
 Sets major label steps. More...
 
void SetMinorIntervalCount (size_t count)
 Set the number of ticks between each label (major interval). More...
 
size_t GetMinorIntervalCout ()
 Get the number of ticks between each label (major interval). More...
 
void SetLabelSkip (int blankLabels)
 
int GetLabelSkip ()
 
void SetLabelColourer (LabelColourer *labelColourer)
 
LabelColourerGetLabelColourer ()
 
void SetAxisVisible (bool bVisible)
 Sets visibility of axis. More...
 
virtual void Draw (wxDC &dc, wxRect rc)
 Performs axis drawing. More...
 
virtual void DrawGridLines (wxDC &dc, wxRect rc)
 Draws grid lines for axis. More...
 
virtual wxCoord GetExtent (wxDC &dc)
 Used to determine minimal size needed to draw axis contents, minimal width for vertical axes, minimal height for horizontal. More...
 
- Public Member Functions inherited from Axis
 Axis (AXIS_LOCATION location)
 Constructs new axis. More...
 
AXIS_LOCATION GetLocation ()
 Returns axis location. More...
 
bool IsVertical ()
 Checks whether axis is vertical. More...
 
bool IsHorizontal ()
 Checks whether axis is horizontal. More...
 
void SetMargins (wxCoord marginMin, wxCoord marginMax)
 Sets minimal/maximal margins for axis. More...
 
void SetMajorGridlinePen (const wxPen &pen)
 Sets the pen to be used for drawing major gridlines. More...
 
void SetMinorGridlinePen (const wxPen &pen)
 Sets the pen to be used for drawing minor gridlines. More...
 
const wxPen & GetMajorGridlinePen ()
 Gets the pen that is currently used to draw major gridlines on this axis. More...
 
const wxPen & GetMinorGridlinePen ()
 Gets the pen that is currently used to draw minor gridlines on this axis. More...
 
size_t GetDatasetCount ()
 Returns dataset counts, linked with this axis. More...
 
DatasetGetDataset (size_t index)
 Returns dataset, linked with this axis at specified index. More...
 
void SetZoomPanMode ()
 
void SetWindowWidth (double winWidth)
 Sets window width. More...
 
double GetWindowWidth ()
 Returns window width. More...
 
void SetWindowPosition (double winPos)
 Sets window position. More...
 
double GetWindowPosition ()
 Returns window position. More...
 
void SetUseWindow (bool useWin)
 Sets whether to use window. More...
 
void SetWindow (double winPos, double winWidth)
 Sets window params (position and width). More...
 
bool IntersectsWindow (double v0, double v1)
 Checks whether line in data space intersects window. More...
 
void GetWindowBounds (double &winMin, double &winMax)
 Returns window bounds. More...
 
void AddDataset (Dataset *dataset)
 internal. More...
 
virtual void GetDataBounds (double &minValue, double &maxValue) const =0
 Returns data bounds. More...
 
virtual bool IsVisible (double value)
 Checks whether data value is visible. More...
 
virtual double BoundValue (double value)
 Returns nearest boundary value. More...
 
virtual wxCoord ToGraphics (wxDC &dc, int minCoord, int gRange, double value)
 Transforms coordinate from data space to graphics space. More...
 
virtual double ToData (wxDC &dc, int minCoord, int gRange, wxCoord g)
 Transforms coordinate from graphics space to data space. More...
 
virtual bool UpdateBounds ()=0
 Performs axis bounds update after dataset/s change.
 

Protected Member Functions

virtual double GetValue (size_t step)=0
 Returns value on step. More...
 
virtual void GetLabel (size_t step, wxString &label)=0
 Returns label on step. More...
 
virtual bool IsEnd (size_t step)=0
 Check whether step is last. More...
 
virtual wxSize GetLongestLabelExtent (wxDC &dc)=0
 
virtual bool HasLabels ()
 
- Protected Member Functions inherited from Axis
virtual bool AcceptDataset (Dataset *dataset)=0
 Checks whether dataset can be accepted by this axis. More...
 

Additional Inherited Members

- Protected Attributes inherited from Axis
DatasetArray m_datasets
 
wxPen m_majorGridlinePen
 
wxPen m_minorGridlinePen
 
wxCoord m_marginMin
 
wxCoord m_marginMax
 
double m_winPos
 
double m_winWidth
 
bool m_useWin
 

Detailed Description

Base class for axes for displaying data labels.

Definition at line 29 of file labelaxis.h.

Member Function Documentation

virtual void LabelAxis::Draw ( wxDC &  dc,
wxRect  rc 
)
virtual

Performs axis drawing.

Parameters
dcdevice context
rcrectangle where to draw

Implements Axis.

virtual void LabelAxis::DrawGridLines ( wxDC &  dc,
wxRect  rcData 
)
virtual

Draws grid lines for axis.

Parameters
dcdevice context
rcdata area rectangle of plot

Implements Axis.

virtual wxCoord LabelAxis::GetExtent ( wxDC &  dc)
virtual

Used to determine minimal size needed to draw axis contents, minimal width for vertical axes, minimal height for horizontal.

Parameters
dcdevice context
Returns
extent

Implements Axis.

virtual void LabelAxis::GetLabel ( size_t  step,
wxString &  label 
)
protectedpure virtual

Returns label on step.

Parameters
stepstep index
labeloutput label

Implemented in NumberAxis, LogarithmicNumberAxis, DateAxis, CategoryAxis, and JulianDateAxis.

Referenced by NumberAxis::ForceExtraMajorInterval(), and DateAxis::SetDateFormat().

wxColour LabelAxis::GetLabelTextColour ( )
inline

Returns label colour.

Returns
label colour

Definition at line 135 of file labelaxis.h.

const wxFont& LabelAxis::GetLabelTextFont ( )
inline

Returns label font.

Returns
label font

Definition at line 153 of file labelaxis.h.

size_t LabelAxis::GetMinorIntervalCout ( )
inline

Get the number of ticks between each label (major interval).

Returns
The number of minor interval ticks that appear between each major interval label.

Definition at line 201 of file labelaxis.h.

References Axis::Draw(), Axis::DrawGridLines(), and Axis::GetExtent().

const wxString& LabelAxis::GetTitle ( )
inline

Returns axis title.

Returns
axis title

Definition at line 49 of file labelaxis.h.

wxColour LabelAxis::GetTitleColour ( )
inline

Returns axis title colour.

Returns
axis title colour

Definition at line 108 of file labelaxis.h.

const wxFont& LabelAxis::GetTitleFont ( )
inline

Returns axis title font.

Returns
axis title font

Definition at line 88 of file labelaxis.h.

int LabelAxis::GetTitleLocation ( )
inline

Returns axis title location.

Returns
axis title location

Definition at line 70 of file labelaxis.h.

virtual double LabelAxis::GetValue ( size_t  step)
protectedpure virtual

Returns value on step.

Parameters
stepstep index
Returns
value on step

Implemented in NumberAxis, LogarithmicNumberAxis, DateAxis, and CategoryAxis.

Referenced by NumberAxis::ForceExtraMajorInterval(), and DateAxis::SetDateFormat().

bool LabelAxis::GetVerticalLabelText ( )
inline

Returns whether to draw labels text vertical.

Returns
true if labels text will be drawn vertical

Definition at line 172 of file labelaxis.h.

virtual bool LabelAxis::IsEnd ( size_t  step)
protectedpure virtual

Check whether step is last.

Parameters
stepstep
Returns
true if step is last

Implemented in NumberAxis, DateAxis, and CategoryAxis.

Referenced by NumberAxis::ForceExtraMajorInterval(), and DateAxis::SetDateFormat().

void LabelAxis::SetAxisVisible ( bool  bVisible)

Sets visibility of axis.

Parameters
bVisible- false if hidden
void LabelAxis::SetLabelPen ( wxPen  labelPen)
inline

Sets pen for label lines.

Parameters
labelPenpen for label lines

Definition at line 117 of file labelaxis.h.

void LabelAxis::SetLabelTextColour ( wxColour  labelTextColour)
inline

Sets colour for labels.

Parameters
labelColourcolor for labels

Definition at line 126 of file labelaxis.h.

void LabelAxis::SetLabelTextFont ( wxFont  labelTextFont)
inline

Sets font for labels text.

Parameters
labelFontfont for labels text

Definition at line 144 of file labelaxis.h.

void LabelAxis::SetMinorIntervalCount ( size_t  count)
inline

Set the number of ticks between each label (major interval).

Parameters
countThe number of minor interval ticks that should appear between each major interval label.

Definition at line 192 of file labelaxis.h.

void LabelAxis::SetTitle ( const wxString &  title)
inline

Sets axis title.

Parameters
newaxis title

Definition at line 40 of file labelaxis.h.

void LabelAxis::SetTitleColour ( wxColour &  colour)
inline

Sets axis title colour.

Parameters
newaxis title colour

Definition at line 97 of file labelaxis.h.

void LabelAxis::SetTitleFont ( wxFont &  font)
inline

Sets axis title font.

Parameters
axistitle font

Definition at line 79 of file labelaxis.h.

void LabelAxis::SetTitleLocation ( int  location)
inline

Sets axis title location.

Parameters
locationnew location for axis title, acceptable values wxLEFT, wxCENTER, wxRIGHT for horizontal axes, wxTOP, wxCENTER, wxBOTTOM for vertical axes.

Definition at line 60 of file labelaxis.h.

void LabelAxis::SetVerticalLabelText ( bool  verticalLabelText)
inline

Sets whether to draw labels text vertical.

Parameters
verticalLabelTexttrue to draw labels text vertical

Definition at line 162 of file labelaxis.h.

LabelAxis::wxDEPRECATED_MSG ( "Use SetMinorIntervalCount instead."  )
inline

Sets major label steps.

Parameters
stepThe step size at which major label should be drawn

Definition at line 181 of file labelaxis.h.

Referenced by NumberAxis::SetTickFormat().


The documentation for this class was generated from the following file: