Class BarChartCategoryXAxis
java.lang.Object
com.amalgamasimulation.charts.axes.AbstractAxis<Number>
com.amalgamasimulation.charts.axes.BarChartCategoryXAxis
- All Implemented Interfaces:
IGetDisplayedRangePropertyOwner,IScrollBarPropertyOwner
public class BarChartCategoryXAxis
extends AbstractAxis<Number>
implements IScrollBarPropertyOwner, IGetDisplayedRangePropertyOwner
Class that represents an X-axis drawn on a
BarChart or
HistogramChart area. The X-axis tick labels represents the names of
the visual set data elements. It holds properties for axis ticks and labels
along the axis. This axis does not allow ranging, zoom or pan operations.- Author:
- Aleksey Kirillov
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternalprotected com.amalgamasimulation.charts.internals.axes.AbstractBarXAxisInternal -
Constructor Summary
ConstructorsConstructorDescriptionBarChartCategoryXAxis(com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternal chartInternal, com.amalgamasimulation.charts.internals.axes.AbstractBarXAxisInternal xAxisInternal) Constructs aBarChartInternalX-axis with givenBarXAxisInternal -
Method Summary
Modifier and TypeMethodDescriptionaddDisplayedRangeChangeHandler(BiConsumer<Double, Double> handler) Adds the action to be executed every time the displayed range changed.Clear all the displayed range changed actions.protected com.amalgamasimulation.charts.internals.axes.AbstractBarXAxisInternalprotected com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternalReturns the currently displayed values range of axis.booleanChecks whether the scrollbar is currently displayed.booleanChecks whether the scrollbar should be drawn if scrolling the displayed rang of Y-axis is possible.Removes the displayed range changed action.setLabelsFormat(Function<Double, String> format) Sets the formatter to axis labels, i.e.setScrollBarVisible(boolean visible) Specifies whether the scrollbar should be drawn if scrolling the displayed rang of axis is possible.Methods inherited from class com.amalgamasimulation.charts.axes.AbstractAxis
getLabelsColor, getLabelsFont, getLabelsFontSize, setGridLinesColor, setGridLinesColor, setGridLinesVisible, setGridLinesWidth, setLabelsColor, setLabelsColor, setLabelsFont, setLabelsFontSize
-
Field Details
-
chartInternal
protected com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternal chartInternal -
xAxisInternal
protected com.amalgamasimulation.charts.internals.axes.AbstractBarXAxisInternal xAxisInternal
-
-
Constructor Details
-
BarChartCategoryXAxis
public BarChartCategoryXAxis(com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternal chartInternal, com.amalgamasimulation.charts.internals.axes.AbstractBarXAxisInternal xAxisInternal) Constructs aBarChartInternalX-axis with givenBarXAxisInternal- Parameters:
chartInternal-BarChartInternalwhich is the owner of this objectxAxisInternal-BarXAxisInternalwhich is the internal axis logic aggregator
-
-
Method Details
-
setLabelsFormat
Sets the formatter to axis labels, i.e. the function that takes aDoublevalue and produces aStringthat should be drawn to represent this value.- Parameters:
format- new axis labels formatter- Returns:
- reference to this object
-
getDisplayedRange
Description copied from interface:IGetDisplayedRangePropertyOwnerReturns the currently displayed values range of axis.- Specified by:
getDisplayedRangein interfaceIGetDisplayedRangePropertyOwner- Returns:
- the pair contains minimum and maximum values of the currently displayed range
-
setScrollBarVisible
Description copied from interface:IScrollBarPropertyOwnerSpecifies whether the scrollbar should be drawn if scrolling the displayed rang of axis is possible. True by default. If set to false, the scrollbar will never be drawn but the functionality of scrolling this axis will still remain. Redraws this axis and it's parent chart if visibility is changed.- Specified by:
setScrollBarVisiblein interfaceIScrollBarPropertyOwner- Parameters:
visible- flag setting if the scrollbar should be drawn if scrolling the displayed rang of axis is possible- Returns:
- reference to this object
- See Also:
-
isScrollBarVisible
public boolean isScrollBarVisible()Description copied from interface:IScrollBarPropertyOwnerChecks whether the scrollbar should be drawn if scrolling the displayed rang of Y-axis is possible.- Specified by:
isScrollBarVisiblein interfaceIScrollBarPropertyOwner- Returns:
trueif the scrollbar should be drawn if scrolling the displayed rang of Y-axis is possible,falseotherwise
-
isScrollBarDisplayed
public boolean isScrollBarDisplayed()Description copied from interface:IScrollBarPropertyOwnerChecks whether the scrollbar is currently displayed.- Specified by:
isScrollBarDisplayedin interfaceIScrollBarPropertyOwner- Returns:
trueif the scrollbar is currently displayed,falseotherwise
-
addDisplayedRangeChangeHandler
Description copied from interface:IGetDisplayedRangePropertyOwnerAdds the action to be executed every time the displayed range changed.- Specified by:
addDisplayedRangeChangeHandlerin interfaceIGetDisplayedRangePropertyOwner- Parameters:
handler- new displayed range changed action- Returns:
- reference to this object
-
removeDisplayedRangeChangeHandler
Description copied from interface:IGetDisplayedRangePropertyOwnerRemoves the displayed range changed action.- Specified by:
removeDisplayedRangeChangeHandlerin interfaceIGetDisplayedRangePropertyOwner- Parameters:
handler- removed displayed range changed action- Returns:
- reference to this object
-
clearDisplayedRangeChangeHandler
Description copied from interface:IGetDisplayedRangePropertyOwnerClear all the displayed range changed actions.- Specified by:
clearDisplayedRangeChangeHandlerin interfaceIGetDisplayedRangePropertyOwner- Returns:
- reference to this object
-
getChartInternal
protected com.amalgamasimulation.charts.internals.charts.AbstractBarChartInternal getChartInternal()- Specified by:
getChartInternalin classAbstractAxis<Number>
-
getAxisInternal
protected com.amalgamasimulation.charts.internals.axes.AbstractBarXAxisInternal getAxisInternal()- Specified by:
getAxisInternalin classAbstractAxis<Number>
-