Interface HasBarDatasetOptions
-
- All Superinterfaces:
IsDefaultBarDatasets
- All Known Implementing Classes:
BarDataset
,ChoroplethDataset
,HorizontalBarDataset
,StackedBarDataset
,StackedHorizontalBarDataset
,TimeSeriesBarDataset
,TimeSeriesHorizontalBarDataset
,TypedDataset
public interface HasBarDatasetOptions extends IsDefaultBarDatasets
Defines a BAR dataset properties of options in order to use the same logic between datasets and options/configuration.- Author:
- Andrea "Stock" Stocchero
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default double
getBarPercentage()
Returns the percent (0-1) of the available width each bar should be within the category width.default int
getBarThickness()
Returns the width of each bar in pixels.default double
getCategoryPercentage()
Returns the percent (0-1) of the available width each category should be within the sample width.BarDatasetOptionsHandler
getDatasetOptionsHandler()
Returns the instance of bar dataset options handler.default int
getMaxBarThickness()
Returns the maximum bar thickness.default int
getMinBarLength()
Returns a minimum length in pixels.default boolean
isGrouped()
Whentrue
, all the data sets at same index value will be placed next to each other centering on that index value.
Whenfalse
, each bar is placed on its actual index-axis value.default void
setBarPercentage(double barPercentage)
Sets the percent (0-1) of the available width each bar should be within the category width.default void
setBarThickness(int barThickness)
Sets the width of each bar in pixels.default void
setCategoryPercentage(double categoryPercentage)
Sets the percent (0-1) of the available width each category should be within the sample width.default void
setGrouped(boolean grouped)
Whentrue
, all the data sets at same index value will be placed next to each other centering on that index value.
Whenfalse
, each bar is placed on its actual index-axis value.default void
setMaxBarThickness(int maxBarThickness)
Sets the maximum bar thickness, to ensure that bars are not sized thicker than thisdefault void
setMinBarLength(int minBarLength)
Set this to ensure that bars have a minimum length in pixels.
-
-
-
Method Detail
-
getDatasetOptionsHandler
BarDatasetOptionsHandler getDatasetOptionsHandler()
Returns the instance of bar dataset options handler.- Returns:
- the instance of bar dataset options handler
-
setBarPercentage
default void setBarPercentage(double barPercentage)
Sets the percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.- Parameters:
barPercentage
- percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.
-
getBarPercentage
default double getBarPercentage()
Returns the percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.- Specified by:
getBarPercentage
in interfaceIsDefaultBarDatasets
- Returns:
- percent (0-1) of the available width each bar should be within the category width. 1.0 will take the whole category width and put the bars right next to each other.
-
setCategoryPercentage
default void setCategoryPercentage(double categoryPercentage)
Sets the percent (0-1) of the available width each category should be within the sample width.- Parameters:
categoryPercentage
- percent (0-1) of the available width each category should be within the sample width.
-
getCategoryPercentage
default double getCategoryPercentage()
Returns the percent (0-1) of the available width each category should be within the sample width.- Specified by:
getCategoryPercentage
in interfaceIsDefaultBarDatasets
- Returns:
- the percent (0-1) of the available width each category should be within the sample width.
-
setBarThickness
default void setBarThickness(int barThickness)
Sets the width of each bar in pixels. If set to 'flex', it computes "optimal" sample widths that globally arrange bars side by side. If not set, the base sample widths are calculated automatically so that they take the full available widths without overlap. Then, the bars are sized using barPercentage and categoryPercentage.- Parameters:
barThickness
- width of each bar in pixels. If not set, the base sample widths are calculated automatically so that they take the full available widths without overlap. Then, the bars are sized using barPercentage and categoryPercentage.
-
getBarThickness
default int getBarThickness()
Returns the width of each bar in pixels. If set to 'flex', it computes "optimal" sample widths that globally arrange bars side by side. If not set, the base sample widths are calculated automatically so that they take the full available widths without overlap. Then, the bars are sized using barPercentage and categoryPercentage.- Specified by:
getBarThickness
in interfaceIsDefaultBarDatasets
- Returns:
- width of each bar in pixels. If not set, the base sample widths are calculated automatically so that they take the full available widths without overlap. Then, the bars are sized using barPercentage and categoryPercentage.
-
setMaxBarThickness
default void setMaxBarThickness(int maxBarThickness)
Sets the maximum bar thickness, to ensure that bars are not sized thicker than this- Parameters:
maxBarThickness
- the maximum bar thickness.
-
getMaxBarThickness
default int getMaxBarThickness()
Returns the maximum bar thickness.- Specified by:
getMaxBarThickness
in interfaceIsDefaultBarDatasets
- Returns:
- the maximum bar thickness.
-
setMinBarLength
default void setMinBarLength(int minBarLength)
Set this to ensure that bars have a minimum length in pixels.- Parameters:
minBarLength
- a minimum length in pixels.
-
getMinBarLength
default int getMinBarLength()
Returns a minimum length in pixels.- Specified by:
getMinBarLength
in interfaceIsDefaultBarDatasets
- Returns:
- a minimum length in pixels.
-
setGrouped
default void setGrouped(boolean grouped)
Whentrue
, all the data sets at same index value will be placed next to each other centering on that index value.
Whenfalse
, each bar is placed on its actual index-axis value.- Parameters:
grouped
- iftrue
, all the data sets at same index value will be placed next to each other centering on that index value
-
isGrouped
default boolean isGrouped()
Whentrue
, all the data sets at same index value will be placed next to each other centering on that index value.
Whenfalse
, each bar is placed on its actual index-axis value.- Specified by:
isGrouped
in interfaceIsDefaultBarDatasets
- Returns:
- if
true
, all the data sets at same index value will be placed next to each other centering on that index value
-
-