Class TickFactory
java.lang.Object
org.eclipse.nebula.visualization.xygraph.linearscale.TickFactory
public class TickFactory
extends java.lang.Object
Tick factory produces the different axis ticks. When specifying a format and
given the screen size parameters and range it will return a list of Ticks
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TickFactory.TickFormatting
tick formatting modes -
Constructor Summary
Constructors Constructor Description TickFactory(IScaleProvider scale)
TickFactory(TickFactory.TickFormatting format, IScaleProvider scale)
-
Method Summary
Modifier and Type Method Description java.util.List<Tick>
generateIndexBasedTicks(double min, double max, int maxTicks)
Generate a list of ticks that span range given by min and max.java.util.List<Tick>
generateLogTicks(double min, double max, int maxTicks, boolean allowMinMaxOver, boolean tight)
java.util.List<Tick>
generateTicks(double min, double max, int maxTicks, boolean allowMinMaxOver, boolean tight)
Generate a list of ticks that span range given by min and max.protected static java.math.BigDecimal
nicenum(java.math.BigDecimal x, boolean round)
protected static double
roundDown(java.math.BigDecimal numerator, java.math.BigDecimal denominator)
Round numerator down to multiples of denominatorsprotected static double
roundUp(java.math.BigDecimal numerator, java.math.BigDecimal denominator)
Round numerator up to multiples of denominators
-
Constructor Details
-
TickFactory
- Parameters:
format
-
-
TickFactory
- Parameters:
format
-
-
-
Method Details
-
roundDown
protected static double roundDown(java.math.BigDecimal numerator, java.math.BigDecimal denominator)Round numerator down to multiples of denominators- Parameters:
numerator
-denominator
-- Returns:
- rounded down value
-
roundUp
protected static double roundUp(java.math.BigDecimal numerator, java.math.BigDecimal denominator)Round numerator up to multiples of denominators- Parameters:
numerator
-denominator
-- Returns:
- rounded up value
-
nicenum
protected static java.math.BigDecimal nicenum(java.math.BigDecimal x, boolean round)- Parameters:
x
-round
- if true, then round else take ceiling- Returns:
- a nice number
-
generateTicks
public java.util.List<Tick> generateTicks(double min, double max, int maxTicks, boolean allowMinMaxOver, boolean tight)Generate a list of ticks that span range given by min and max. The maximum number of ticks is exceed by one in the case where the range straddles zero.- Parameters:
min
-max
-maxTicks
-allowMinMaxOver
- allow min/maximum overwritetight
- if true then remove ticks outside range- Returns:
- a list of the ticks for the axis
-
generateIndexBasedTicks
Generate a list of ticks that span range given by min and max.- Parameters:
min
-max
-maxTicks
-- Returns:
- a list of the ticks for the axis
-
generateLogTicks
public java.util.List<Tick> generateLogTicks(double min, double max, int maxTicks, boolean allowMinMaxOver, boolean tight)- Parameters:
min
- (must be >0)max
- (must be >0)maxTicks
-allowMinMaxOver
- allow min/maximum overwritetight
- if true then remove ticks outside range- Returns:
- a list of the ticks for the axis
-