|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gicentre.utils.stat.AbstractChart
org.gicentre.utils.stat.XYChart
public class XYChart
Class for representing X-Y charts such as scatterplots or line charts.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.gicentre.utils.stat.AbstractChart |
---|
AbstractChart.Side |
Field Summary |
---|
Fields inherited from class org.gicentre.utils.stat.AbstractChart |
---|
axisFormatter, data, logTics, parent, tics, transposeAxes |
Constructor Summary | |
---|---|
XYChart(processing.core.PApplet parent)
Initialises an XY chart. |
Method Summary | |
---|---|
void |
draw(float xOrigin,
float yOrigin,
float width,
float height)
Draws the X-Y chart within the given bounds. |
void |
setData(float[] xValues,
float[] yValues)
Sets the data to be plotted in the X-Y chart. |
void |
setData(java.util.List<processing.core.PVector> data)
Sets the data to be plotted in the X-Y chart |
void |
setLineColour(int colour)
Determines the colour of the line to be displayed on the chart. |
void |
setLineWidth(float width)
Determines the width of the line to be displayed on the chart. |
void |
setLogX(boolean isLog)
Determines whether or not the values on the x axis are log10 scaled. |
void |
setLogY(boolean isLog)
Determines whether or not the values on the y axis are log10 scaled. |
void |
setMaxX(float maxX)
Sets the maximum value for x values to be represented. |
void |
setMaxY(float maxY)
Sets the minimum value for y values to be represented. |
void |
setMinX(float minX)
Sets the minimum value for x values to be represented. |
void |
setMinY(float minY)
Sets the minimum value for y values to be represented. |
void |
setPointColour(float[] colourData,
ColourTable cTable)
Provides the data and colour table from which to colour points. |
void |
setPointColour(int colour)
Determines the colour of the points to be displayed on the chart. |
void |
setPointSize(float size)
Determines the size of the points to be displayed on the chart. |
void |
setPointSize(float[] sizeData,
float maxSize)
Sizes points to be displayed on the chart according to the given set of data. |
void |
setXAxisAt(float xValue)
Sets the position of the x-axis. |
void |
setXAxisLabel(java.lang.String label)
Sets the x-axis label. |
void |
setXFormat(java.lang.String format)
Sets the numerical format for numbers shown on the x-axis. |
void |
setYAxisAt(float yValue)
Sets the position of the y-axis. |
void |
setYAxisLabel(java.lang.String label)
Sets the y-axis label. |
void |
setYFormat(java.lang.String format)
Sets the numerical format for numbers shown on the y-axis. |
void |
showXAxis(boolean showAxis)
Determines whether or not the axis representing the x data is shown. |
void |
showYAxis(boolean showAxis)
Determines whether or not the axis representing the y data is shown. |
Methods inherited from class org.gicentre.utils.stat.AbstractChart |
---|
convertToLog, getBorder, getIsLogScale, getMax, getMaxLog, getMin, getMinBorder, getMinLog, getShowAxis, setBorder, setData, setFormat, setIsLogScale, setMax, setMin, setMinBorder, setMinBorder, setRange, showAxis |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XYChart(processing.core.PApplet parent)
parent
- Parent sketch in which this chart is to be drawn.Method Detail |
---|
public void setData(float[] xValues, float[] yValues)
xValues
- Array of x values to plot.yValues
- Array of y values to plot.public void setData(java.util.List<processing.core.PVector> data)
data
- Collection of pairs of (x,y) data values, each stored in a PVector.public void draw(float xOrigin, float yOrigin, float width, float height)
draw
in class AbstractChart
xOrigin
- left-hand pixel coordinate of the area in which to draw the chart.yOrigin
- top pixel coordinate of the area in which to draw the chart.width
- Width in pixels of the area in which to draw the chart.height
- Height in pixels of the area in which to draw the chart.public void setPointColour(int colour)
colour
- Colour of points to be displayed.public void setPointColour(float[] colourData, ColourTable cTable)
setData()
.
colourData
- Data used to colour points.cTable
- Colour table that translates data values into colours.public void setLineColour(int colour)
colour
- Colour of line to be displayed.public void setPointSize(float size)
size
- Size of points to be displayed in pixel units.public void setPointSize(float[] sizeData, float maxSize)
setData()
.
sizeData
- Data used to size points.maxSize
- Size in pixel units of the largest point.public void setLineWidth(float width)
width
- Width of line to be displayed in pixel units.public void showXAxis(boolean showAxis)
showAxis
- x-axis is shown if true.public void showYAxis(boolean showAxis)
showAxis
- y-axis is shown if true.public void setMinX(float minX)
minX
- Minimum x-value to be represented on the x-axis.public void setMinY(float minY)
minY
- Minimum y-value to be represented on the y-axis.public void setMaxX(float maxX)
maxX
- Maximum x-value to be represented on the x-axis.public void setMaxY(float maxY)
maxY
- Maximum y-value to be represented on the y-axis.public void setXAxisLabel(java.lang.String label)
label
- x-axis label to draw or null if no label to be drawn.public void setYAxisLabel(java.lang.String label)
label
- y-axis label to draw or null if no label to be drawn.public void setXAxisAt(float xValue)
xValue
- Position of axis in data units.public void setYAxisAt(float yValue)
yValue
- Position of axis in data units.public void setXFormat(java.lang.String format)
format
- Format for numbers on the x-axis.public void setYFormat(java.lang.String format)
format
- Format for numbers on the y-axis.public void setLogX(boolean isLog)
isLog
- True if x-axis values are to be log10-scaled or false if linear.public void setLogY(boolean isLog)
isLog
- True if y-axis values are to be log10-scaled or false if linear.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |