Contents Up Previous Next

wxChartLayout: wxObject

This abstract class is used for drawing a Chart. You must derive a new class from this, and define member functions to access the data that wxChartLayout needs. See the functions wxStoredChart::GetData and wxStoredChart::SetData in a derived class that I have written for the test program included with this library: wxStoredBarLineChart.

The application should call Draw to Draw the Chart.

wxChartLayout::wxChartLayout
wxChartLayout::AddDataSet
wxChartLayout::Draw
wxChartLayout::Get3D
wxChartLayout::GetOrientation
wxChartLayout::GetDataStyle
wxChartLayout::GetData
wxChartLayout::GetLabel
wxChartLayout::SetEdgeTop
wxChartLayout::SetEdgeBottom
wxChartLayout::SetEdgeLeft
wxChartLayout::SetEdgeRight
wxChartLayout::SetTitle
wxChartLayout::GetTitle
wxChartLayout::SetTitleFont
wxChartLayout::GetTitleFont
wxChartLayout::SetMaxWidthHeight
wxChartLayout::SetChartCenter
wxChartLayout::SetStartEndCol
wxChartLayout::SetDataSetOrder
wxChartLayout::SetMajorTickInc
wxChartLayout::SetMinorTickInc
wxChartLayout::GetMajorTickInc
wxChartLayout::GetMinorTickInc
wxChartLayout::SetTailText
wxChartLayout::SetHeadText
wxChartLayout::GetTailText
wxChartLayout::GetHeadText
wxChartLayout::SetTickStyle
wxChartLayout::GetTickStyle
wxChartLayout::ShowValues
wxChartLayout::GetShowValues
wxChartLayout::SetOrientation
wxChartLayout::SetDataType
wxChartLayout::SetLineStyle
wxChartLayout::GetLineStyle
wxChartLayout::SetDataStyle
wxChartLayout::Set3D
wxChartLayout::SetData
wxChartLayout::SetLabel


wxChartLayout::wxChartLayout

void wxChartLayout(wxCavas *canvas = NULL)

Constructor.


wxChartLayout::AddDataSet

int AddDataSet(int dataType, int row)

int AddDataSet(int dataType, wxList rows=-1)

Used to Add a new dataset to a Chart.

dataType is one of

Use row for single row dataType and use rows for a list of rows when using multiple row data types like wxPercentBar, wxFloatingBar.


wxChartLayout::Draw

void Draw(void)

Call this to let wxChartLayout draw the chart itself. The device context must have been set in the constructor or using SetDC.


wxChartLayout::Get3D

Bool Get3D(void)


wxChartLayout::GetOrientation

int GetOrientation(void)

Returns the current orientation of the chart, wxHORIZONTAL or wxVERTICAL.


wxChartLayout::GetDataStyle

wxBrush * GetDataStyle(void)


wxChartLayout::GetData

float GetData(int col, int row)

Virtual function to allow access to data using col and row. This must be defined in your class derived from wxChartLayout.


wxChartLayout::GetLabel

char * GetLabel(int col, int row)

Virtual function to allow access to data Label using col and row. This must be defined in your class derived from wxChartLayout.


wxChartLayout::SetEdgeTop

void SetEdgeTop(int top)

Sets the maximmum edge from the top that the data in graph may be drawn to.


wxChartLayout::SetEdgeBottom

void SetEdgeBottom(int bottom)

Sets the maximmum edge from the bottom that the data in graph may be drawn to.


wxChartLayout::SetEdgeLeft

void SetEdgeLeft(int left)

Sets the maximmum edge from the left that the data in graph may be drawn to.


wxChartLayout::SetEdgeRight

void SetEdgeRight(int right)

Sets the maximmum edge from the right that the data in graph may be drawn to.


wxChartLayout::SetTitle

void SetTitle(char *title)

Allows the title of the chart to be set.


wxChartLayout::GetTitle

char * GetTitle(void)

Returns the title of the chart.


wxChartLayout::SetTitleFont

void SetTitleFont(wxFont *titlefont)

Allows the title font to be set.


wxChartLayout::GetTitleFont

wxFont * GetTitleFont(void)


wxChartLayout::SetMaxWidthHeight

long SetMaxWidthHeight(int width, int height) Sets the maximmum width, height of the chart. This area includes the edges which are not drawn in by the data and reserved for labels, titles, etc.


wxChartLayout::SetChartCenter

void SetChartCenter(int x, int y) Sets the center coordinates of the chart.


wxChartLayout::SetStartEndCol

void SetStartEndCol(int colStart, int colEnd)

This should be a virtual function, but it basically sets the range of columns that the chart gets the data to display from. For example 8-20 will plot data from column 8 to column 20.


wxChartLayout::SetDataSetOrder

This is not currently implemented but I intend to support prioritizing the layout of datasets so that the layout may be specified (somehow).


wxChartLayout::SetMajorTickInc

void SetMajorTickInc(int inc)

Sets the increment size for Major tick marks.


wxChartLayout::SetMinorTickInc

void SetMinorTickInc(int inc)

Sets the increment size for Minor tick marks.


wxChartLayout::GetMajorTickInc

void GetMajorTickInc(void)

Gets the increment size for Major tick marks.


wxChartLayout::GetMinorTickInc

int GetMinorTickInc(void)

Gets the increment size for Minor tick marks.


wxChartLayout::SetTailText

void SetTailText(char *text)

Allows an optional text string to appended to the data values. Could be used to put a percentage sign after each value on the axis.


wxChartLayout::SetHeadText

void SetHeadText(char *text)

Allows an optional text string to prepend to the data values. Can't think of any use but you may find it useful.

Gets the increment size for Minor tick marks.


wxChartLayout::GetTailText

char * GetTailText(void)

Returns the text tail text of value labels the axis.


wxChartLayout::GetHeadText

void GetHeadText(void)

Returns the text header text of value labels

Gets the increment size for Minor tick marks.


wxChartLayout::SetTickStyle

void SetTickStyle(int style) Valid styles are:


wxChartLayout::GetTickStyle

int GetTickStyle(void) Returns the tick style of the axis. See SetTickStyle for valid styles.


wxChartLayout::ShowValues

float ShowValues(Bool bool) Determines whether the data values of bars are displayed inside the bar.


wxChartLayout::GetShowValues

Bool GetShowValues(void) Returns TRUE if values are currently displayed inside bars.


wxChartLayout::SetOrientation

void SetOrientation(int orient) Valid chart orientations are wxHORIZONTAL and wxVERTICAL.


wxChartLayout::SetDataType

void SetDataType(int dataset, int datatype)

Sets the graph type of the supplied dataset. See wxChartLayout::wxChartLayout.


wxChartLayout::SetLineStyle

void SetLineStyle(int dataset, wxPen *pen)

Sets the line style (pen).


wxChartLayout::GetLineStyle

wxPen * GetLineStyle(void)

Returns the current pen.


wxChartLayout::SetDataStyle

void SetDataStyle(int dataset, wxBrush *brush)

Sets the brush used for drawing the data.


wxChartLayout::Set3D

void Set3D(Bool bool)

Sets 3D display mode.


wxChartLayout::SetData

void SetData(int col, int row, float value) Virtual function to allow access to data using col and row. This must be defined in your class derived from wxChartLayout.


wxChartLayout::SetLabel

void SetLabel(int col, int row, char *label)

Virtual function to allow access to data Label using col and row. This must be defined in your class derived from wxChartLayout.