Interface ChartCore
access this type via: stats.chart.ChartCore (provides, requires or uses)
--- extends:GraphicsObject
This is the base type for a set of different charts, which is responsible for drawing the axes / grid / markers of the chart, and also calculating how to project decimal values into the integer render space. Use one of the sub-types of this interface to instantiate a particular kind of chart.
Constants
byte AXIS_X
byte AXIS_Y
int ATTR_NONE
int ATTR_MARKERS
int ATTR_NUMBERS
int ATTR_GRID
int ATTR_AUTO
Functions
ChartCore()
void setSize(int w, int h)
WH getSize()
void setAxisFont(storeFont f)
void setLabelFont(storeFont f)
void setXMinMax(dec min, dec max)
void setXLabelInterval(dec ivr)
void setXMarkerInterval(dec ivr)
void setXGridInterval(dec ivr)
void setYMinMax(dec min, dec max)
void setYLabelInterval(dec ivr)
void setYMarkerInterval(dec ivr)
void setYGridInterval(dec ivr)
void setDecimalPlaces(byte axisType, int num)
void setAxisLabels(char x[], char y[])
void evenAxisSpacing(byte axisType, byte attributeType)
void setAxisFinish(byte axisType, byte attributeType)
void setAxisLabelSpace(byte axisType, int pixels)
int[] getPlotPoint(dec x, dec y)
void preparePlotArea()
void drawGrid(Canvas c)
void drawAxes(Canvas c)
Rect getPlotArea()
Constants
AXIS_X
AXIS_Y
ATTR_NONE
ATTR_MARKERS
ATTR_NUMBERS
ATTR_GRID
ATTR_AUTO
ChartCore()
void setSize(int w, int h)
Set the size of the chart in pixels.
WH getSize()
Get the size of the chart in pixels.
void setAxisFont(storeFont f)
Set the font used for the axis numbering.
void setLabelFont(storeFont f)
Set the font used for the axis text labels.
void setXMinMax(dec min, dec max)
Set the minimum and maximum value of the X-axis. This range must be at least enough to render every value on the graph, plus error bars if in use.
void setXLabelInterval(dec ivr)
Set the interval between numbers on the X-axis (if this is 0.0, no numbers will be shown).
void setXMarkerInterval(dec ivr)
Set the interval between markers on the X-axis (if this is 0.0, no markers will be shown).
void setXGridInterval(dec ivr)
Set the interval between grid lines on the X-axis (if this is 0.0, no grid will be shown).
void setYMinMax(dec min, dec max)
Set the minimum and maximum value of the Y-axis. This range must be at least enough to render every value on the graph, plus error bars if in use.
void setYLabelInterval(dec ivr)
Set the interval between numbers on the Y-axis (if this is 0.0, no numbers will be shown).
void setYMarkerInterval(dec ivr)
Set the interval between markers on the Y-axis (if this is 0.0, no markers will be shown).
void setYGridInterval(dec ivr)
Set the interval between grid lines on the Y-axis (if this is 0.0, no grid will be shown).
void setDecimalPlaces(byte axisType, int num)
Set the number of decimal places to which numbers are displayed on axes.
void setAxisLabels(char x[], char y[])
Set the text labels to appear on the x-axis and y-axis of the graph.
void evenAxisSpacing(byte axisType, byte attributeType)
This function forces the given axis attribute (grid, markers, or numbers) to have even spacing when projected into an integer coordinate space. Using this feature may cause the effective plot area to be smaller than the pixel height/width given in setSize().
void setAxisFinish(byte axisType, byte attributeType)
This function ensures that the given axis finishes on the given attribute (grid, marker, or number).
void setAxisLabelSpace(byte axisType, int pixels)
This function controls the amount of white space between the given axis and the axis title.
int[] getPlotPoint(dec x, dec y)
Get the integer coordinates on the plot area, in pixels, at which the given x/y decimal values would appear.
x The decimal x value.
y The decimal y value.
void preparePlotArea()
Requests the chart to configure its plot area, based on all parameters given to the chart, ready for getPlotPoint to be called.
void drawGrid(Canvas c)
Draws the grid lines of the chart (if any).
void drawAxes(Canvas c)
Draws the axes of the chart.
Rect getPlotArea()
Returns the rect describing the area to which values will be plotted, excluding labels, numbers and markers.