sgtplot
Interface TimeAxisStyle
-
public interface TimeAxisStyleTimeAxisStyledefines an interface to create a specific time axis style. Currently there are five time axes styles,MINUTE_HOUR,HOUR_DAY,DAY_MONTH,MONTH_YEAR, andYEAR_DECADE. All time axes have two labeling levels, minor and major. For example,DAY_MONTHstyle has a minor level of days and a major level of months.- Since:
- 1.0
- See Also:
TimeAxis
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidcomputeDefaults(GeoDate delta)Determine the minor label interval from the time extent of the axis.doublecomputeLocation(double prev, double now)Determines the location of the minor time label.java.lang.StringgetDefaultMajorLabelFormat()Get the default major label format.intgetDefaultMajorLabelInterval()Get the default major label interval.java.lang.StringgetDefaultMinorLabelFormat()Get the default minor label format.intgetDefaultMinorLabelInterval()Get the default minor label interval.intgetDefaultNumSmallTics()Get the default number of small tics between each minor tic.intgetIncrementUnits()Get the increment units for the minor labeling.doublegetIncrementValue()Get the increment value for the minor labeling.intgetMajorValue(GeoDate time)Get the major time value for labeling.intgetMinorValue(GeoDate time)Get the minor time value for labeling.GeoDategetStartTime(TimeRange trange)Returns a beginning time rounded to the nearest minor increment.booleanisRoomForMajorLabel(GeoDate delta)Determines if there is enough room indeltatime for another major label.booleanisStartOfMinor(GeoDate time)Determines iftimeis the start of a minor interval.java.lang.StringtoString()
-
-
-
Method Detail
-
getMinorValue
int getMinorValue(GeoDate time)
Get the minor time value for labeling.- Parameters:
time- current date- Returns:
- minor time value
-
getMajorValue
int getMajorValue(GeoDate time)
Get the major time value for labeling.- Parameters:
time- current date- Returns:
- major time value
-
isRoomForMajorLabel
boolean isRoomForMajorLabel(GeoDate delta)
Determines if there is enough room indeltatime for another major label.- Returns:
- true if enough room exists
-
isStartOfMinor
boolean isStartOfMinor(GeoDate time)
Determines iftimeis the start of a minor interval.- Returns:
- true if start of minor interval
-
getDefaultMinorLabelFormat
java.lang.String getDefaultMinorLabelFormat()
Get the default minor label format. The default minor labels are "mm", "HH", "dd", "MMM", and "yy" forMINUTE_HOUR,HOUR_DAY,DAY_MONTH,MONTH_YEAR, andYEAR_DECADE, respectively.- Returns:
- minor label format
-
getDefaultMajorLabelFormat
java.lang.String getDefaultMajorLabelFormat()
Get the default major label format. The default major labels are "yyyy-MM-dd HH", "yyyy-MM-dd", "yyyy-MM", "yyyy", and "yyyy" forMINUTE_HOUR,HOUR_DAY,DAY_MONTH,MONTH_YEAR, andYEAR_DECADE, respectively.- Returns:
- major label format
-
getDefaultMinorLabelInterval
int getDefaultMinorLabelInterval()
Get the default minor label interval.- Returns:
- minor label interval
-
getDefaultMajorLabelInterval
int getDefaultMajorLabelInterval()
Get the default major label interval.- Returns:
- major label interval
-
getDefaultNumSmallTics
int getDefaultNumSmallTics()
Get the default number of small tics between each minor tic.- Returns:
- number of small tics
-
getStartTime
GeoDate getStartTime(TimeRange trange)
Returns a beginning time rounded to the nearest minor increment. For example, forDAY_MONTHif time is increasing then round to the day beforetRange.startotherwise the nearest day aftertRange.end.- Parameters:
tRange- time range of the axis
-
getIncrementValue
double getIncrementValue()
Get the increment value for the minor labeling. The value is 1.0 for all styles.- Returns:
- increment value
-
getIncrementUnits
int getIncrementUnits()
Get the increment units for the minor labeling. The value isGeoDate.MINUTES,GeoDate.HOURS,GeoDate.DAYS,GeoDate.MONTHS, andGoeDate.YEARSforMINUTE_HOUR,HOUR_DAY,DAY_MONTH,MONTH_YEAR, andYEAR_DECADE, respectively.- Returns:
- increment units
- See Also:
GeoDate
-
computeDefaults
void computeDefaults(GeoDate delta)
Determine the minor label interval from the time extent of the axis. For example, ifdeltais greater than 30 days, greater than 10 and less that 30 days, or less than 10 days, the interval is 5, 2, or 1, respectively, forDAY_MONTHstyle.- Parameters:
delta- time extent
-
computeLocation
double computeLocation(double prev, double now)Determines the location of the minor time label. Positions the label between the tic marks forDAY_MONTH,MONTH_YEAR, andYEAR_DECADE, or at the tic mark forMINUTES_HOURSandHOURS_DAYS.- Parameters:
prev- previous tic locationnow- current tic location
-
toString
java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-
DMelt 3.0 © DataMelt by jWork.ORG