Class AxisTickCalculator_
java.lang.Object
org.knowm.xchart.internal.chartpart.AxisTickCalculator_
- All Implemented Interfaces:
AxisTickCalculator
- Direct Known Subclasses:
AxisTickCalculator_Callback, AxisTickCalculator_Category, AxisTickCalculator_Date, AxisTickCalculator_Logarithmic, AxisTickCalculator_Number
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) final Axis.Direction(package private) Format(package private) final double(package private) final double(package private) final AxesChartStylerthe List of tick label valuesthe List of tick label position in pixels(package private) final double -
Constructor Summary
ConstructorsConstructorDescriptionAxisTickCalculator_(Axis.Direction axisDirection, double workingSpace, double minValue, double maxValue, List<Double> axisValues, AxesChartStyler styler) AxisTickCalculator_(Axis.Direction axisDirection, double workingSpace, double minValue, double maxValue, AxesChartStyler styler) Constructor -
Method Summary
Modifier and TypeMethodDescription(package private) booleanareAllTickLabelsUnique(List<?> tickLabels) private booleanareValuesEquallySpaced(List<Double> values) protected voidprivate voidcalculateForEquallySpacedAxisValues(double tickSpace, double margin) Calculates the ticks so that they only appear at positions where data is available.(package private) doublegetFirstPosition(double gridStep) Gets the first positionprivate booleanisNumberFormatChoppingDecimals(double axisMax, double axisMin) (package private) booleanwillLabelsFitInTickSpaceHint(List<String> tickLabels, int tickSpacingHint) Given the generated tickLabels, will they fit side-by-side without overlapping each other and looking bad? Sometimes the given tickSpacingHint is simply too small.
-
Field Details
-
tickLocations
-
tickLabels
-
axisDirection
-
workingSpace
final double workingSpace -
minValue
final double minValue -
maxValue
final double maxValue -
axisValues
-
styler
-
axisFormat
Format axisFormat
-
-
Constructor Details
-
AxisTickCalculator_
AxisTickCalculator_(Axis.Direction axisDirection, double workingSpace, double minValue, double maxValue, AxesChartStyler styler) Constructor- Parameters:
axisDirection-workingSpace-minValue-maxValue-styler-
-
AxisTickCalculator_
AxisTickCalculator_(Axis.Direction axisDirection, double workingSpace, double minValue, double maxValue, List<Double> axisValues, AxesChartStyler styler)
-
-
Method Details
-
getFirstPosition
double getFirstPosition(double gridStep) Gets the first position- Parameters:
gridStep-- Returns:
-
getTickLocations
- Specified by:
getTickLocationsin interfaceAxisTickCalculator
-
getTickLabels
- Specified by:
getTickLabelsin interfaceAxisTickCalculator
-
willLabelsFitInTickSpaceHint
-
getAxisFormat
- Specified by:
getAxisFormatin interfaceAxisTickCalculator
-
calculate
protected void calculate() -
areValuesEquallySpaced
-
calculateForEquallySpacedAxisValues
private void calculateForEquallySpacedAxisValues(double tickSpace, double margin) Calculates the ticks so that they only appear at positions where data is available.- Parameters:
tickSpace- a percentage of the working space available for ticksmargin- where the tick should begin in the working space in pixels
-
areAllTickLabelsUnique
-
isNumberFormatChoppingDecimals
private boolean isNumberFormatChoppingDecimals(double axisMax, double axisMin)
-