Package com.inet.report.chart.axis
Class ContinuousDateAxis
- java.lang.Object
-
- com.inet.report.chart.axis.BaseAxis
-
- com.inet.report.chart.axis.ContinuousDateAxis
-
- All Implemented Interfaces:
com.inet.report.chart.axis.ContinuousAxis
,com.inet.report.chart.axis.MarkerAxis
,java.io.Serializable
public class ContinuousDateAxis extends BaseAxis implements com.inet.report.chart.axis.ContinuousAxis, com.inet.report.chart.axis.MarkerAxis
This axis displays a continuous time line with values. Used as data axis by gantt or as continuous category axis.- Since:
- 8.0
- See Also:
BaseAxis
,ContinuousAxis
, Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description static int
STEP_AUTO
The step width of the axis labels is defined automatically.static int
STEP_DAY
Constant defining the step width of the axis labels as one day.static int
STEP_HOUR
Constant defining the step width of the axis labels as one hour.static int
STEP_MILLISECOND
Constant defining the step width of the axis labels as one millisecond.static int
STEP_MINUTE
Constant defining the step width of the axis labels as one minute.static int
STEP_MONTH
Constant defining the step width of the axis labels as one month.static int
STEP_SECOND
Constant defining the step width of the axis labels as one second.static int
STEP_YEAR
Constant defining the step width of the axis labels as one year.-
Fields inherited from class com.inet.report.chart.axis.BaseAxis
DEFAULT_AXIS_LINE_COLOR, DEFAULT_GRIDLINE_COLOR, DEFAULT_TICK_LABEL_COLOR, DEFAULT_TICK_LABEL_FONT, DEFAULT_TITLE, TOKEN_CATEGORY_AXIS, TOKEN_DATA_AXIS, TOKEN_SERIES_AXIS
-
-
Constructor Summary
Constructors Constructor Description ContinuousDateAxis()
Creates a continuous date axis.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addMarker(AbstractMarker marker)
Adds a new marker to the marker list of this axis.DateRange
getDateRange()
Returns the range controller object which is responsible for determining the range to be shown on the axisjava.lang.Integer
getDateStepWidthType()
Returns the date step width of axis units - a step will be 1 of the unit returned.int
getLabelAngle()
Gets the label angle in degree with a range from 0 to 359.AbstractMarker
getMarker(int index)
Returns the marker from position.int
getMarkersCount()
Returns the total amount of markers on this axis.java.lang.Integer
getNumberOfDateSteps()
Returns the number of steps ornull
if the number of steps should be defined automatically.java.util.List<java.lang.Object>
getReferencedObjects()
Get FormulaFields referenced by this Axis.
Can be from marker (if this is MarkerAxis) or from title.protected java.lang.StringBuilder
getSubProperties(int depth)
Returns the serialized properties of subclasses.boolean
isAutomaticScale()
Returns whether or not the axis range is automatically adjusted to fit the data values.boolean
isRotateLabels()
Returns whether the axis labels are to be rotated by 90 degrees from the axis direction.void
readProperties(org.w3c.dom.Element element, Chart2 chart)
Loads the XML properties of a chart axis.void
removeMarker(int index)
Removes the marker at the position given.protected void
saveSubProperties(java.io.PrintWriter out, int depth)
Writes the intern axis properties to output.void
setAutomaticScale(boolean isAutomaticScale)
Sets a flag that determines whether or not the axis range is automatically adjusted to fit the data, and notifies registered listeners that the axis has been modified.void
setDateRange(DateRange range)
Sets the range controller object.void
setDateStepWidthType(java.lang.Integer dateStep)
Sets date step width of axis units: a step will be 1 of whichever unit is provided.void
setLabelAngle(int labelAngle)
Sets the label angle for rotating the axis labels in degrees.void
setNumberOfDateSteps(java.lang.Integer numberOfDateSteps)
Sets the number of date steps.void
setRotateLabels(boolean rotate)
Sets whether the axis labels are to be rotated 90 degrees from the axis direction.-
Methods inherited from class com.inet.report.chart.axis.BaseAxis
copyTo, getAxisLineColor, getAxisPosition, getGridlineColor, getTickLabelColor, getTickLabelFont, getTickLabelFormat, getTitle, isGridlinesVisible, isInverseOrder, saveProperties, setAxisLineColor, setAxisPosition, setGridlineColor, setGridlinesVisible, setInverseOrder, setTickLabelColor, setTickLabelFont, setTickLabelFormat, setTitle
-
-
-
-
Field Detail
-
STEP_AUTO
public static final int STEP_AUTO
The step width of the axis labels is defined automatically.- See Also:
- Constant Field Values
-
STEP_MILLISECOND
public static final int STEP_MILLISECOND
Constant defining the step width of the axis labels as one millisecond.- See Also:
- Constant Field Values
-
STEP_SECOND
public static final int STEP_SECOND
Constant defining the step width of the axis labels as one second.- See Also:
- Constant Field Values
-
STEP_MINUTE
public static final int STEP_MINUTE
Constant defining the step width of the axis labels as one minute.- See Also:
- Constant Field Values
-
STEP_HOUR
public static final int STEP_HOUR
Constant defining the step width of the axis labels as one hour.- See Also:
- Constant Field Values
-
STEP_DAY
public static final int STEP_DAY
Constant defining the step width of the axis labels as one day.- See Also:
- Constant Field Values
-
STEP_MONTH
public static final int STEP_MONTH
Constant defining the step width of the axis labels as one month.- See Also:
- Constant Field Values
-
STEP_YEAR
public static final int STEP_YEAR
Constant defining the step width of the axis labels as one year.- See Also:
- Constant Field Values
-
-
Method Detail
-
isAutomaticScale
public boolean isAutomaticScale()
Returns whether or not the axis range is automatically adjusted to fit the data values.- Returns:
- whether or not the axis range is automatically adjusted to fit the data values.
- Since:
- 8.0
- See Also:
setAutomaticScale(boolean)
-
setAutomaticScale
public void setAutomaticScale(boolean isAutomaticScale)
Sets a flag that determines whether or not the axis range is automatically adjusted to fit the data, and notifies registered listeners that the axis has been modified.- Parameters:
isAutomaticScale
- the flag- Since:
- 8.0
- See Also:
isAutomaticScale()
-
isRotateLabels
public boolean isRotateLabels()
Returns whether the axis labels are to be rotated by 90 degrees from the axis direction.- Returns:
- whether the labels are to be rotated.
- Since:
- 8.0
- See Also:
setRotateLabels(boolean)
-
setRotateLabels
public void setRotateLabels(boolean rotate)
Sets whether the axis labels are to be rotated 90 degrees from the axis direction.- Parameters:
rotate
- whether the labels are to be rotated- Since:
- 8.0
- See Also:
isRotateLabels()
-
getLabelAngle
public int getLabelAngle()
Gets the label angle in degree with a range from 0 to 359.- Returns:
- the label angle
- Since:
- 23.4
-
setLabelAngle
public void setLabelAngle(int labelAngle)
Sets the label angle for rotating the axis labels in degrees. It should be between 0 and 359.- Parameters:
labelAngle
- the new label angle- Since:
- 23.4
-
getDateRange
public DateRange getDateRange()
Returns the range controller object which is responsible for determining the range to be shown on the axis- Returns:
- the range
- Since:
- 8.0
- See Also:
setDateRange(DateRange)
-
setDateRange
public void setDateRange(DateRange range)
Sets the range controller object.- Parameters:
range
- the rage (null
not permitted)- Throws:
java.lang.IllegalArgumentException
- if range isnull
.- Since:
- 8.0
- See Also:
getDateRange()
-
getDateStepWidthType
public java.lang.Integer getDateStepWidthType()
Returns the date step width of axis units - a step will be 1 of the unit returned.- Returns:
- the step width or
null
if the step width should be defined automatically. Will be one of the STEP_xxx constants. - Since:
- 8.0
- See Also:
setDateStepWidthType(Integer)
,STEP_MILLISECOND
,STEP_SECOND
,STEP_MINUTE
,STEP_HOUR
,STEP_DAY
,STEP_MONTH
,STEP_YEAR
-
setDateStepWidthType
public void setDateStepWidthType(java.lang.Integer dateStep)
Sets date step width of axis units: a step will be 1 of whichever unit is provided. This function supports the listed constants ornull
to define the step width automatically.- Parameters:
dateStep
- the date step width (null
permitted). See the STEP_xxx constants- Throws:
java.lang.IllegalArgumentException
- when an unsupported type is given.- Since:
- 8.0
- See Also:
getDateStepWidthType()
,STEP_MILLISECOND
,STEP_SECOND
,STEP_MINUTE
,STEP_HOUR
,STEP_DAY
,STEP_MONTH
,STEP_YEAR
-
getNumberOfDateSteps
public java.lang.Integer getNumberOfDateSteps()
Returns the number of steps ornull
if the number of steps should be defined automatically.- Returns:
- the numberOfDateSteps.
- Since:
- 8.0
- See Also:
setNumberOfDateSteps(Integer)
-
setNumberOfDateSteps
public void setNumberOfDateSteps(java.lang.Integer numberOfDateSteps)
Sets the number of date steps. This property works only if a date step width type was defined.- Parameters:
numberOfDateSteps
- the number of date steps ornull
to define the number of steps automatically- Throws:
java.lang.IllegalArgumentException
- if numberOfDateSteps less or equal 0.- Since:
- 8.0
- See Also:
getNumberOfDateSteps()
,setDateStepWidthType(Integer)
-
addMarker
public void addMarker(AbstractMarker marker)
Adds a new marker to the marker list of this axis.- Specified by:
addMarker
in interfacecom.inet.report.chart.axis.MarkerAxis
- Parameters:
marker
- (null
not permitted)- Throws:
java.lang.IllegalArgumentException
- if marker isnull
.- Since:
- 8.0
- See Also:
getMarker(int)
,removeMarker(int)
,getMarkersCount()
-
getMarker
public AbstractMarker getMarker(int index)
Returns the marker from position.- Specified by:
getMarker
in interfacecom.inet.report.chart.axis.MarkerAxis
- Parameters:
index
- the position of marker in the marker list- Returns:
- the marker.
- Throws:
java.lang.IndexOutOfBoundsException
- if the index out of bounds.- Since:
- 8.0
- See Also:
addMarker(AbstractMarker)
,removeMarker(int)
,getMarkersCount()
-
removeMarker
public void removeMarker(int index)
Removes the marker at the position given.- Specified by:
removeMarker
in interfacecom.inet.report.chart.axis.MarkerAxis
- Parameters:
index
- the position at which to remove a marker from the list of markers- Throws:
java.lang.IndexOutOfBoundsException
- if the index out of bounds.- Since:
- 8.0
- See Also:
addMarker(AbstractMarker)
,getMarker(int)
,getMarkersCount()
-
getMarkersCount
public int getMarkersCount()
Returns the total amount of markers on this axis.- Specified by:
getMarkersCount
in interfacecom.inet.report.chart.axis.MarkerAxis
- Returns:
- the number of markers on this axis.
- Since:
- 8.0
- See Also:
addMarker(AbstractMarker)
,getMarker(int)
,removeMarker(int)
-
getSubProperties
protected java.lang.StringBuilder getSubProperties(int depth)
Returns the serialized properties of subclasses.- Overrides:
getSubProperties
in classBaseAxis
- Parameters:
depth
- the depth of XML indent- Returns:
- the properties.
-
saveSubProperties
protected void saveSubProperties(java.io.PrintWriter out, int depth)
Writes the intern axis properties to output. Overwrites this to save intern properties direct toPrintWriter
without building aStringBuilder
.- Overrides:
saveSubProperties
in classBaseAxis
- Parameters:
out
- the outputdepth
- the depth of XML indent
-
readProperties
public void readProperties(org.w3c.dom.Element element, Chart2 chart)
Loads the XML properties of a chart axis.- Overrides:
readProperties
in classBaseAxis
- Parameters:
element
- DOM element to read the properties fromchart
- the current chart. Any formula will be registered at the chart's renderer. Not null.- Since:
- 8.0
- See Also:
BaseAxis.saveProperties(PrintWriter, int, String)
-
getReferencedObjects
public java.util.List<java.lang.Object> getReferencedObjects()
Get FormulaFields referenced by this Axis.
Can be from marker (if this is MarkerAxis) or from title. Adds the formulas from the date range.- Overrides:
getReferencedObjects
in classBaseAxis
- Returns:
- a list with referenced fields, can be empty.
-
-