wxFreeChart
Public Member Functions | Static Public Attributes | List of all members
Legend Class Reference

Legend. More...

#include <legend.h>

Public Member Functions

 Legend (int vertPosition, int horizPosition, AreaDraw *background=new FillAreaDraw(), int symbolTextGap=2, int margin=2)
 Constructs new legend. More...
 
void Draw (wxDC &dc, wxRect rc, DatasetArray &datasets)
 Draw legend. More...
 
void Draw (wxDC &dc, wxRect rc, CategoryDataset &dataset)
 
int GetVertPosition ()
 Returns legend vertical position. More...
 
int GetHorizPosition ()
 Returns legend horizontal position. More...
 
void SetTextFont (wxFont font)
 Sets font to draw legend labels. More...
 
wxFont GetTextFont ()
 Returns font to draw legend labels. More...
 
wxSize GetExtent (wxDC &dc, DatasetArray &datasets)
 Returns size of area to draw legend. More...
 
wxSize GetExtent (wxDC &dc, CategoryDataset &dataset)
 

Static Public Attributes

static const wxCoord labelsSpacing
 Space between serie labels.
 

Detailed Description

Legend.

Performs legend drawing.

Definition at line 21 of file legend.h.

Constructor & Destructor Documentation

Legend::Legend ( int  vertPosition,
int  horizPosition,
AreaDraw background = new FillAreaDraw(),
int  symbolTextGap = 2,
int  margin = 2 
)

Constructs new legend.

Parameters
vertPositionvertical position, can be wxTOP, wxCENTER, wxBOTTOM
horizPositionhorizontal position, can be wxLEFT, wxCENTER, wxRIGHT
backgroundbackground for legend area
symbolTextGapdistance between symbol and text
marginlegend margin

Member Function Documentation

void Legend::Draw ( wxDC &  dc,
wxRect  rc,
DatasetArray datasets 
)

Draw legend.

Parameters
dcdevice context
rcrectangle where to draw
datasetsdatasets array
wxSize Legend::GetExtent ( wxDC &  dc,
DatasetArray datasets 
)

Returns size of area to draw legend.

Parameters
dcdevice context
datasetesdataset array
Returns
size needed for legend area
int Legend::GetHorizPosition ( )
inline

Returns legend horizontal position.

Returns
legend horizontal position

Definition at line 64 of file legend.h.

wxFont Legend::GetTextFont ( )
inline

Returns font to draw legend labels.

Returns
font to draw legend labels

Definition at line 82 of file legend.h.

int Legend::GetVertPosition ( )
inline

Returns legend vertical position.

Returns
legend vertical position

Definition at line 55 of file legend.h.

void Legend::SetTextFont ( wxFont  font)
inline

Sets font to draw legend labels.

Parameters
fontnew font to draw legend labels

Definition at line 73 of file legend.h.


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