public class BarSeries extends GeneralBarSeries
AxesGraph graph = new AxesGraph(); BarSeries series = new BarSeries("Fruit"); series.set("Apples", 10); series.set("Oranges", 13); graph.addSeries(series);Adding a BarSeries to an
AxesGraph
will typically result in the X-axis being
set to a BarAxis
, and the default ordering of the bars is the order they're
added to the Series.
Internally values in a Bar Series are treated as numbers, the same as all the other
series. So, for instance, in the example above "Apples" is 0 and "Oranges" is 1. Then
the BarAxis
formats those numbers to display the correct text. This becomes
important to know when adding Markers to the graph using the Series.addMarker
method.
For instance, to display some text above the "Apples" bar in the example above, you
would call something like series.addMarker(new Text("Text", style), 0, 12)
bardepth, barwidth, bottombarwidth, max, min, order
Constructor and Description |
---|
BarSeries(String name)
Create a new BarSeries
|
Modifier and Type | Method and Description |
---|---|
void |
set(String name,
double height)
Add a bar to the series.
|
void |
set(String name,
double min,
double max)
Add a bar to the series, which does not necessarily have to start at
y=0 . |
addMarker, drawBox, getStyle, isBarsAtNoon, setBarDepth, setBarLabels, setBarWidth, setBarWidth, setBarWidth, setRoundBars, setRoundBars, setStyle
addBox, addLine, addMarker, getName, outputToSeries, outputToSeriesFunction, setFloatingPointX, setFloatingPointY, setStyle, toString
public BarSeries(String name)
name
- the name of the seriespublic void set(String name, double height)
barseries.set("Apples", 10); barseries.set("Apples ", 10);
name
- the name of the barheight
- the value of the barpublic void set(String name, double min, double max)
y=0
.
This can be used to create "floating" bars.name
- the name of the barmin
- the bottom-most Y co-ordinate of the barmax
- the top-most Y co-ordinate of the barCopyright © 2001-2016 Big Faceless Organization