org.faceless.graph
Class BarGraph
java.lang.Object
org.faceless.graph.Graph
org.faceless.graph.AxesGraph
org.faceless.graph.AbstractBarGraph
org.faceless.graph.BarGraph
public class BarGraph
- extends AbstractBarGraph
A concrete subclass of AbstractBarGraph that handles the simplest type
of Bar Graph - a single row of bars, running across the X axis.
By Default, the BarGraph
turns off the external key by
calling optionDisplayKey(Graph.KEY_NONE)
. This is because
all the information required is displayed on the axes of the Graph.
Here's an example showing a simple BarGraph.
import org.faceless.graph.output.ImageOutput;
import java.awt.Color;
// Create a new Bar Graph, and set some options.
//
BarGraph g = new BarGraph();
optionTitle("My First Bar Graph");
optionXAxisLabel("Type of Fruit");
optionYAxisLabel("Quantity Eaten");
// Add some bars to the graph. Compare something
// other than apples and oranges for a change.
//
g.set("Pomegranites", 20);
g.set("Soursops", 15);
g.set("Fejoas", 8);
g.set("Kumquats", 9.5);
g.set("Kiwaglis", 11.7);
g.set("Tamarillos", 28);
g.set("Mangosteens", 28);
// Render to an image that's 400x400
//
ImageOutput out = new ImageOutput(400,400);
out.render(g);
Method Summary |
void |
set(String set,
double val)
Set the value of the specified entry
|
void |
setColor(String set,
Paint color)
Set the color of an entry |
Methods inherited from class org.faceless.graph.AxesGraph |
optionAxisStyle, optionBoxColor, optionFloorStyle, optionMaxY, optionMinY, optionXAxisAtZero, optionXAxisLabel, optionXAxisLabelStyle, optionXAxisStyle, optionXAxisTextRotation, optionXFormatter, optionYAxisAtZero, optionYAxisLabel, optionYAxisLabelStyle, optionYAxisStyle, optionYAxisTextRotation, optionYFormatter, optionYWallStyle, optionZAxisStyle, optionZFormatter, optionZWallStyle |
Methods inherited from class org.faceless.graph.Graph |
getDefaultBorderColor, getFontScale, optionDisplayKey, optionFixedAspectRatio, optionKeyBoxStyle, optionKeyStyle, optionSubTitle, optionSubTitleStyle, optionTitle, optionTitleStyle, optionXRotation, optionYRotation, optionZRotation, setDefaultBorderColor, setDefaultColors, setDefaultLineThickness, setFontScale, setLicenseKey, setLightLevel, setLightVector, setPieEdgeDegrees, toCanvas |
BarGraph
public BarGraph()
setColor
public void setColor(String set,
Paint color)
- Set the color of an entry
set
public void set(String set,
double val)
Set the value of the specified entry
- Parameters:
set
- the entry on the X-axis to plot the value againstval
- the value to plot
- Throws:
IllegalArgumentException
- if paramater val is infinite.
Copyright © 2001-2012 Big Faceless Organization