Package org.faceless.graph2
Class StackedBarSeries
- java.lang.Object
-
- org.faceless.graph2.Series
-
- org.faceless.graph2.GeneralBarSeries
-
- org.faceless.graph2.StackedBarSeries
-
public class StackedBarSeries extends GeneralBarSeries
A StackedBarSeries creates a bar graph where the bars are stacked on top of each other. Typically this series is used to show components of a whole.
-
-
Constructor Summary
Constructors Constructor Description StackedBarSeries(String name)Create a new StackedBarSeries
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidadd(BarSeries series)Add a BarSeries to this set.voidsetBarDepth(double depth)Set the depth of each bar.voidsetBarGap(double gap)Set the size of the gap between each bar.voidsetBarWidth(double width)Set the width of each bar.voidsetBarWidth(double topwidth, double bottomwidth)Set the width of each bar.voidsetBarWidth(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
-
StackedBarSeries
public StackedBarSeries(String name)
Create a new StackedBarSeries- Parameters:
name- the name of the series
-
-
Method Detail
-
setBarGap
public void setBarGap(double gap)
Set the size of the gap between each bar. The default value of 0 leaves no gaps, or this can be set to a value which is the absolute size of the gaps between each section.- Parameters:
gap- the size of the gap between each bar- Since:
- 2.4
-
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, anIllegalArgumentExceptionwill be thrown.
-
setBarWidth
public void setBarWidth(double width)
Description copied from class:GeneralBarSeriesSet the width 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:
setBarWidthin classGeneralBarSeries- Parameters:
width- the width of the bar - must be 0 < width <= 1
-
setBarWidth
public void setBarWidth(double topwidth, double bottomwidth)Description copied from class:GeneralBarSeriesSet 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:
setBarWidthin 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:GeneralBarSeriesSet 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:
setBarWidthin 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:GeneralBarSeriesSet 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:
setBarDepthin classGeneralBarSeries- Parameters:
depth- the depth of the bar - must be 0 < depth <= 1
-
-