public class BarDataset extends HovingFlexDataset implements HasDataPoints
Modifier and Type | Field and Description |
---|---|
static int |
FLEX_BAR_THICKNESS
If set to 'flex', the base sample widths are calculated automatically based on the previous and following samples so that
they take the full available widths without overlap.
|
Constructor and Description |
---|
BarDataset()
Creates a dataset.
It uses the global options has default. |
BarDataset(IsDefaultOptions defaultValues)
Creates the dataset using a default.
|
Modifier and Type | Method and Description |
---|---|
double |
getBarPercentage()
Returns the percent (0-1) of the available width each bar should be within the category width.
|
int |
getBarThickness()
Returns the width of each bar in pixels.
|
BorderSkipped |
getBorderSkipped()
Returns the edge to skip drawing the border for.
|
BorderSkippedCallback |
getBorderSkippedCallback()
Returns the border skipped callback, if set, otherwise
null . |
BarBorderWidth |
getBorderWidthAsItem()
Returns the stroke width of the bar in pixels.
|
double |
getCategoryPercentage()
Returns the percent (0-1) of the available width each category should be within the sample width.
|
protected String |
getDefaultBackgroundColorAsString()
Returns the default background color value based on type of chart.
|
protected String |
getDefaultBorderColorAsString()
Returns the default border color value based on type of chart.
|
protected int |
getDefaultBorderWidth()
Returns the default border width value based on type of chart.
|
String |
getLabel()
Returns the label for the dataset which appears in the legend and tooltips.
|
int |
getMaxBarThickness()
Returns the maximum bar thickness.
|
int |
getMinBarLength()
Returns a minimum length in pixels.
|
default int |
getOrder()
Returns the drawing order of dataset.
Also affects order for stacking, tooltip, and legend. |
Orderer |
getOrderer()
Returns an order option manager instance.
|
String |
getXAxisID()
Returns the ID of the x axis to plot this dataset on.
|
String |
getYAxisID()
Returns the ID of the y axis to plot this dataset on.
|
void |
setBarPercentage(double barPercentage)
Sets the percent (0-1) of the available width each bar should be within the category width.
|
void |
setBarThickness(int barThickness)
Sets the width of each bar in pixels.
|
void |
setBorderSkipped(boolean borderskip)
Sets the edge to skip drawing the border for.
|
void |
setBorderSkipped(BorderSkipped borderskip)
Sets the edge to skip drawing the border for.
|
void |
setBorderSkipped(BorderSkippedCallback borderSkippedCallback)
Sets the border skipped callback.
|
void |
setBorderWidth(BarBorderWidth borderWidth)
Sets the stroke width of the bar in pixels.
|
void |
setCategoryPercentage(double categoryPercentage)
Sets the percent (0-1) of the available width each category should be within the sample width.
|
void |
setMaxBarThickness(int maxBarThickness)
Sets the maximum bar thickness, to ensure that bars are not sized thicker than this
|
void |
setMinBarLength(int minBarLength)
Set this to ensure that bars have a minimum length in pixels.
|
default void |
setOrder(int order)
Sets the drawing order of dataset.
Also affects order for stacking, tooltip, and legend. |
void |
setXAxisID(String xAxisID)
Sets the ID of the x axis to plot this dataset on.
|
void |
setYAxisID(String yAxisID)
Sets the ID of the y axis to plot this dataset on.
|
applyGradient, applyPattern, getBackgroundColor, getBackgroundColorAsGradient, getBackgroundColorAsPatterns, getBackgroundColorAsString, getBorderColor, getBorderColorAsGradient, getBorderColorAsString, getBorderWidth, getHoverBackgroundColor, getHoverBackgroundColorAsGradient, getHoverBackgroundColorAsPatterns, getHoverBackgroundColorAsString, getHoverBorderColor, getHoverBorderColorAsGradient, getHoverBorderColorAsString, getHoverBorderWidth, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBackgroundColor, setBorderColor, setBorderColor, setBorderColor, setBorderWidth, setHoverBackgroundColor, setHoverBackgroundColor, setHoverBackgroundColor, setHoverBackgroundColor, setHoverBorderColor, setHoverBorderColor, setHoverBorderColor, setHoverBorderWidth
getBackgroundColorCallback, getBorderColorCallback, getBorderWidthCallback, getData, getData, getDataset, getDataType, getDefaultValues, getId, getOptions, getType, hasOptions, isHidden, setBackgroundColor, setBorderColor, setBorderWidth, setData, setData, setHidden, setLabel, setOptions, setType
checkValue, getArrayValue, getNativeObject, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValue, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, getValueOrArray, has, has, keys, remove, remove, removeIfExists, setArrayValue, setArrayValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValue, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, setValueOrArray, toJSON, type
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getDataPoints, getDataPoints, setDataPoints, setDataPoints
getDataset
public static final int FLEX_BAR_THICKNESS
Integer.MIN_VALUE
.public BarDataset()
public BarDataset(IsDefaultOptions defaultValues)
defaultValues
- default optionspublic Orderer getOrderer()
public String getLabel()
public void setXAxisID(String xAxisID)
xAxisID
- the ID of the x axis to plot this dataset on. If not specified, this defaults to the ID of the first found
x axis.public String getXAxisID()
public void setYAxisID(String yAxisID)
yAxisID
- the ID of the y axis to plot this dataset on. If not specified, this defaults to the ID of the first found
y axis.public String getYAxisID()
public void setBarPercentage(double barPercentage)
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.public double getBarPercentage()
public void setCategoryPercentage(double categoryPercentage)
categoryPercentage
- percent (0-1) of the available width each category should be within the sample width.public double getCategoryPercentage()
public void setBarThickness(int barThickness)
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.public int getBarThickness()
public void setMaxBarThickness(int maxBarThickness)
maxBarThickness
- the maximum bar thickness.public int getMaxBarThickness()
public void setMinBarLength(int minBarLength)
minBarLength
- a minimum length in pixels.public int getMinBarLength()
public void setBorderWidth(BarBorderWidth borderWidth)
borderWidth
- the stroke width of the bar in pixels.public BarBorderWidth getBorderWidthAsItem()
public void setBorderSkipped(boolean borderskip)
borderskip
- to set false
as border skipped. If set true
, is ignoredpublic void setBorderSkipped(BorderSkipped borderskip)
borderskip
- the edge to skip drawing the border for.public BorderSkipped getBorderSkipped()
public BorderSkippedCallback getBorderSkippedCallback()
null
.null
.public void setBorderSkipped(BorderSkippedCallback borderSkippedCallback)
borderSkippedCallback
- the border skipped callback to setprotected String getDefaultBackgroundColorAsString()
Dataset
getDefaultBackgroundColorAsString
in class Dataset
protected String getDefaultBorderColorAsString()
Dataset
getDefaultBorderColorAsString
in class Dataset
protected int getDefaultBorderWidth()
Dataset
getDefaultBorderWidth
in class Dataset
public void setOrder(int order)
order
- the drawing order of dataset.public int getOrder()