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
void wxChartLayout(wxCavas *canvas = NULL)
Constructor.
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.
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.
Bool Get3D(void)
int GetOrientation(void)
Returns the current orientation of the chart, wxHORIZONTAL or wxVERTICAL.
wxBrush * GetDataStyle(void)
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.
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.
void SetEdgeTop(int top)
Sets the maximmum edge from the top that the data in graph may be drawn to.
Sets the maximmum edge from the bottom that the data in graph may be drawn to.
void SetEdgeLeft(int left)
Sets the maximmum edge from the left that the data in graph may be drawn to.
void SetEdgeRight(int right)
Sets the maximmum edge from the right that the data in graph may be drawn to.
void SetTitle(char *title)
Allows the title of the chart to be set.
char * GetTitle(void)
Returns the title of the chart.
void SetTitleFont(wxFont *titlefont)
Allows the title font to be set.
wxFont * GetTitleFont(void)
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.
void SetChartCenter(int x, int y) Sets the center coordinates of the chart.
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.
This is not currently implemented but I intend to support prioritizing the layout of datasets so that the layout may be specified (somehow).
void SetMajorTickInc(int inc)
Sets the increment size for Major tick marks.
void SetMinorTickInc(int inc)
Sets the increment size for Minor tick marks.
void GetMajorTickInc(void)
Gets the increment size for Major tick marks.
int GetMinorTickInc(void)
Gets the increment size for Minor tick marks.
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.
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.
char * GetTailText(void)
Returns the text tail text of value labels the axis.
void GetHeadText(void)
Returns the text header text of value labels
Gets the increment size for Minor tick marks.
void SetTickStyle(int style) Valid styles are:
int GetTickStyle(void) Returns the tick style of the axis. See SetTickStyle for valid styles.
float ShowValues(Bool bool) Determines whether the data values of bars are displayed inside the bar.
Bool GetShowValues(void) Returns TRUE if values are currently displayed inside bars.
void SetOrientation(int orient) Valid chart orientations are wxHORIZONTAL and wxVERTICAL.
void SetDataType(int dataset, int datatype)
Sets the graph type of the supplied dataset. See wxChartLayout::wxChartLayout.
void SetLineStyle(int dataset, wxPen *pen)
Sets the line style (pen).
wxPen * GetLineStyle(void)
Returns the current pen.
void SetDataStyle(int dataset, wxBrush *brush)
Sets the brush used for drawing the data.
void Set3D(Bool bool)
Sets 3D display mode.
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.
Virtual function to allow access to data Label using col and row. This must be defined in your class derived from wxChartLayout.