|
||||||||||
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.BarChart
public class BarChart
Represents a bar chart. Appearance can be customised such as display of axes, bar colours, orientations etc.
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 | |
---|---|
BarChart(processing.core.PApplet parent)
Initialises a bar chart. |
Method Summary | |
---|---|
void |
draw(float xOrigin,
float yOrigin,
float width,
float height)
Draws the bar chart within the given bounds. |
void |
setBarColour(float[] colourData,
ColourTable cTable)
Provides the data and colour table from which to colour bars. |
void |
setBarColour(int colour)
Determines the colours of the bars to be displayed on the chart. |
void |
setBarGap(float gap)
Sets the gap between adjacent bars. |
void |
setBarLabels(java.lang.String[] labels)
Sets the bar names to be displayed as axis labels. |
void |
setCategoryFormat(java.lang.String format)
Sets the numerical format for numbers shown on the category axis. |
void |
setData(float[] values)
Sets the data values to be displayed in the chart. |
void |
setLogValues(boolean isLog)
Determines whether or not the values represented by the length of each bar should be log10-scaled. |
void |
setMaxValue(float maxVal)
Sets the maximum value for the bar chart. |
void |
setMinValue(float minVal)
Sets the minimum value for the bar chart. |
void |
setReverseCategories(boolean reverse)
Determines if the order of the category values should be reversed or not. |
void |
setValueFormat(java.lang.String format)
Sets the numerical format for numbers shown on the value axis. |
void |
showCategoryAxis(boolean showAxis)
Determines whether or not the category axis is drawn. |
void |
showValueAxis(boolean showAxis)
Determines whether or not the value axis is drawn. |
void |
transposeAxes(boolean transpose)
Determines if the axes should be transposed (so that categories appear on the vertical axis and values on the horizontal axis). |
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 BarChart(processing.core.PApplet parent)
parent
- Parent sketch in which this chart is to be drawn.Method Detail |
---|
public void setData(float[] values)
values
- Sequence of values to chart.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 setLogValues(boolean isLog)
isLog
- True if values are to be log10-scaled or false if linear.public void setMinValue(float minVal)
minVal
- Minimum value to use for scaling bar lengths.public void setMaxValue(float maxVal)
maxVal
- Maximum value to use for scaling bar lengths.public void setBarLabels(java.lang.String[] labels)
labels
- Array of labels corresponding to each of the bars in the chart.public void showValueAxis(boolean showAxis)
showAxis
- Value axis is drawn if true.public void showCategoryAxis(boolean showAxis)
showAxis
- Category axis is drawn if true.public void transposeAxes(boolean transpose)
transpose
- Axes are transposed if true.public void setBarGap(float gap)
gap
- Gap between adjacent bars in pixelspublic void setReverseCategories(boolean reverse)
reverse
- Category order reversed if true.public void setValueFormat(java.lang.String format)
format
- Format for numbers on the value axis.public void setCategoryFormat(java.lang.String format)
format
- Format for numbers on the category axis.public void setBarColour(int colour)
colour
- Colour of bars.public void setBarColour(float[] colourData, ColourTable cTable)
setData()
.
colourData
- Data used to colour barscTable
- Colour table that translates data values into colours.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |