public class BarCategoryAxis extends CartesianCategoryAxis
Constructor and Description |
---|
BarCategoryAxis(AbstractChart<?,?> chart)
Builds the object storing the chart instance.
|
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.
|
CartesianAxisType |
getCartesianType()
Returns the axis type
|
double |
getCategoryPercentage()
Returns the percent (0-1) of the available width each category should be within the sample width.
|
AbstractChart<?,?> |
getChart()
Returns the chart instance
|
protected T |
getConfiguration()
Returns the configuration element.
|
GridLines |
getGrideLines()
Returns the grid lines element
|
String |
getId()
The ID is used to link datasets and scale axes together.
This is especially needed if multi-axes charts are used. |
int |
getMaxBarThickness()
Returns the maximum bar thickness.
|
Position |
getPosition()
Position of the axis in the chart.
|
CartesianScaleLabel |
getScaleLabel()
Returns the scale label element
|
boolean |
isOffset()
If true, extra space is added to the both edges and the axis is scaled to fit into the chart area.
|
boolean |
isStacked()
Gets if the axis are stacked or not.
|
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 |
setCategoryPercentage(double categoryPercentage)
Sets the percent (0-1) of the available width each category should be within the sample width.
|
protected void |
setConfiguration(T configuration) |
void |
setId(String id)
The ID is used to link datasets and scale axes together.
This is especially needed if multi-axes charts are used. |
void |
setMaxBarThickness(int maxBarThickness)
Sets the maximum bar thickness, to ensure that bars are not sized thicker than this
|
void |
setOffset(boolean offset)
If true, extra space is added to the both edges and the axis is scaled to fit into the chart area.
|
void |
setPosition(Position position)
Position of the axis in the chart.
|
void |
setStacked(boolean stacked)
Sets if the axis are stacked or not.
|
String |
toJSON()
Returns the JSON representation of the object.
|
getTicks
getAxisBuildTicksCallback, getAxisCalculateTickRotationCallback, getAxisDataLimitsCallback, getAxisDimensionsCallback, getAxisFitCallback, getAxisTickToLabelConversionCallback, getAxisUpdateCallback, getType, getWeight, isDisplay, setAxisBuildTicksCallback, setAxisCalculateTickRotationCallback, setAxisDataLimitsCallback, setAxisDimensionsCallback, setAxisFitCallback, setAxisTickToLabelConversionCallback, setAxisUpdateCallback, setDisplay, setType, setWeight
public BarCategoryAxis(AbstractChart<?,?> chart)
chart
- chart instancepublic 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 GridLines getGrideLines()
public CartesianScaleLabel getScaleLabel()
public CartesianAxisType getCartesianType()
public void setStacked(boolean stacked)
stacked
- if the axis are stacked or not.public boolean isStacked()
public void setOffset(boolean offset)
offset
- extra space of axispublic boolean isOffset()
public void setId(String id)
id
- The ID is used to link datasets and scale axes togetherpublic String getId()
public void setPosition(Position position)
position
- position of axispublic Position getPosition()
protected final void setConfiguration(T configuration)
configuration
- the configuration to setprotected final T getConfiguration()
public final String toJSON()
public final AbstractChart<?,?> getChart()