Package org.faceless.graph2
Class MultiBarSeries
- java.lang.Object
-
- org.faceless.graph2.Series
-
- org.faceless.graph2.GeneralBarSeries
-
- org.faceless.graph2.MultiBarSeries
-
public class MultiBarSeries extends GeneralBarSeries
This type of Bar Series allows several sets of bars to be "grouped", ie drawn next to eachother. In 3D you could just add severalBarSeries
to a graph and draw one behind the other, but in 2-D this is a good alternative.
-
-
Constructor Summary
Constructors Constructor Description MultiBarSeries(String name)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
add(BarSeries series)
Add a BarSeries to this set.void
setBarDepth(double depth)
Set the depth of each bar.void
setBarWidth(double width)
Set the width of each set of bars.void
setBarWidth(double topwidth, double bottomwidth)
Set the width of each bar.void
setBarWidth(double topwidth, double middlewidth, double bottomwidth)
Set the width of each bar.-
Methods inherited from class org.faceless.graph2.GeneralBarSeries
addMarker, setBarLabels, setRoundBars, setRoundBars, setStyle
-
Methods inherited from class org.faceless.graph2.Series
addBox, addLine, addMarker, getName, outputToSeries, outputToSeriesFunction, setStyle, toString
-
-
-
-
Constructor Detail
-
MultiBarSeries
public MultiBarSeries(String name)
-
-
Method Detail
-
setBarWidth
public void setBarWidth(double width)
Set the width of each set of bars. If you imagine the set of bars sitting on a square that's 1x1, by default the set takes up the whole of that square. ThesetBarWidth(double)
andGeneralBarSeries.setBarDepth(double)
methods control how much of that square is filled. The default width and depth are both 1, ie. the whole square is used. Note that since 2.2 the width of a bar set may be set independently of the individual series in that set.- Parameters:
width
- the width of the bar set - must be 0 < width <= 1
-
add
public void add(BarSeries series)
Add a BarSeries to this set.- Parameters:
series
- the Series to add to this set. If the Series has already been added, anIllegalArgumentException
will be thrown.
-
setBarWidth
public void setBarWidth(double topwidth, double bottomwidth)
Description copied from class:GeneralBarSeries
Set the width of each bar. Similar toGeneralBarSeries.setBarWidth(double)
, but this method allows you to "taper" the bar to be wider at the top or bottom. This method is used to draw pyramids instead of regular bar charts. All values must be between 0 and 1 inclusive.- Overrides:
setBarWidth
in classGeneralBarSeries
- Parameters:
topwidth
- the width of the bar at the topbottomwidth
- the width of the bar at the bottom
-
setBarWidth
public void setBarWidth(double topwidth, double middlewidth, double bottomwidth)
Description copied from class:GeneralBarSeries
Set the width of each bar. Similar toGeneralBarSeries.setBarWidth(double)
, but this method allows you to "taper" the bar to be wider at the top or bottom with a middle "waist". This method is used to draw "funnels" instead of regular bar charts. All values must be between 0 and 1 inclusive.- Overrides:
setBarWidth
in classGeneralBarSeries
- Parameters:
topwidth
- the width of the bar at the topmiddlewidth
- the width of the bar at the middlebottomwidth
- the width of the bar at the bottom
-
setBarDepth
public void setBarDepth(double depth)
Description copied from class:GeneralBarSeries
Set the depth of each bar. If you imagine a bar sitting on a square that's 1x1, by default the bar takes up the whole of that square. TheGeneralBarSeries.setBarWidth(double)
andGeneralBarSeries.setBarDepth(double)
methods control how much of that square is filled. The default width and depth are both 1, ie. the whole square is used.- Overrides:
setBarDepth
in classGeneralBarSeries
- Parameters:
depth
- the depth of the bar - must be 0 < depth <= 1
-
-