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 doublegetBarPercentage()Returns the percent (0-1) of the available width each bar should be within the category width.default intgetBarThickness()Returns the width of each bar in pixels.default doublegetCategoryPercentage()Returns the percent (0-1) of the available width each category should be within the sample width.BarDatasetOptionsHandlergetDatasetOptionsHandler()Returns the instance of bar dataset options handler.default intgetMaxBarThickness()Returns the maximum bar thickness.default intgetMinBarLength()Returns a minimum length in pixels.default booleanisGrouped()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 voidsetBarPercentage(double barPercentage)Sets the percent (0-1) of the available width each bar should be within the category width.default voidsetBarThickness(int barThickness)Sets the width of each bar in pixels.default voidsetCategoryPercentage(double categoryPercentage)Sets the percent (0-1) of the available width each category should be within the sample width.default voidsetGrouped(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 voidsetMaxBarThickness(int maxBarThickness)Sets the maximum bar thickness, to ensure that bars are not sized thicker than thisdefault voidsetMinBarLength(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:
getBarPercentagein 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:
getCategoryPercentagein 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:
getBarThicknessin 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:
getMaxBarThicknessin 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:
getMinBarLengthin 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:
isGroupedin interfaceIsDefaultBarDatasets- Returns:
- if
true, all the data sets at same index value will be placed next to each other centering on that index value
-
-