Package com.jfcbuilder.builders
Class XYTimeSeriesPlotBuilder
java.lang.Object
com.jfcbuilder.builders.XYTimeSeriesPlotBuilder
- All Implemented Interfaces:
IXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
public class XYTimeSeriesPlotBuilder
extends Object
implements IXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
Builder for producing general XYPlot plots using configured builder properties, series, and
datasets.
-
Method Summary
Modifier and TypeMethodDescriptionannotation
(IXYAnnotationBuilder<?> annotation) Registers an IXYAnnotationBuilder whosebuild()
method will be called to generate its XYAnnotation when this plot builder'sbuild()
method is called.Sets the axis color to use when building the plot.axisFontColor
(Paint color) Sets the axis font color to use when building the plot.backgroundColor
(Paint color) Sets the plot background color to use when building the plot.org.jfree.chart.plot.XYPlot
build()
Builds the XYPlot from all configured data and properties.static XYTimeSeriesPlotBuilder
get()
Factory method for obtaining new instances of this class.Deprecated.indexRange
(ZeroBasedIndexRange indexRange) Sets the zero-based index range used to index into all source data for building the XYPlot.majorGrid
(boolean enabled) Toggles displaying major grid lines ON or OFF.majorGridColor
(Paint color) Sets the major grid color to use when building the plot.majorGridStyle
(Stroke style) Sets the major grid line style to use when building the plot.marker
(MarkerBuilder line) Registers aMarkerBuilder
whosebuild()
method will be called to generate its plot line when this plot builder'sbuild()
method is called.minorGrid
(boolean enabled) Toggles displaying minor grid lines ON or OFF.minorGridColor
(Paint color) Sets the minor grid color to use when building the plot.minorGridStyle
(Stroke style) Sets the minor grid line style to use when building the plot.Sets displaying all grid lines OFF.int
Gets the currently configured plot weight.plotWeight
(int weight) Sets the plot weight to be attributed to the plot.series
(IXYTimeSeriesBuilder<?> series) Registers an IXYTimeSeriesBuilder whosebuild()
method will be called to generate its XYTimeSeries when this plot builder'sbuild()
method is called.series
(IXYTimeSeriesDatasetBuilder<?> dataset) Registers an IXYDatasetBuilder whosebuild()
method will be called to generate its XYDataset when this plot builder'sbuild()
method is called.showTimeGaps
(boolean showTimeGaps) Toggle whether to show time gaps at x-values where there is no corresponding time instance.timeData
(long[] timeData) Sets the date-time values to be used when building the plot.xAxis
(org.jfree.chart.axis.ValueAxis xAxis) Sets the x-axis used when building the plot.Sets the plot's y-axis name.yAxisRange
(double lower, double upper) Sets an explicit y-axis value range to use instead of having the y-axis auto-calculate it.yAxisTickSize
(double size) Sets the plot's y-axis tick size.yTickFormat
(NumberFormat format) Sets the plot's y-axis tick format.
-
Method Details
-
get
Factory method for obtaining new instances of this class.- Returns:
- New instance of this class
-
indexRange
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets the zero-based index range used to index into all source data for building the XYPlot. This is an optimization to allow clients to supply existing data without having to copy and/or crop it to match the desired size axis range in the chart.- Specified by:
indexRange
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
indexRange
- The index range to be set- Returns:
- Reference to this builder instance for method chaining
-
xAxis
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets the x-axis used when building the plot.- Specified by:
xAxis
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
xAxis
- The axis to be set- Returns:
- Reference to this builder instance for method chaining
-
timeData
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets the date-time values to be used when building the plot.- Specified by:
timeData
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
timeData
- The date-time values representing the milliseconds since the epoch start- Returns:
- Reference to this builder instance for method chaining
-
showTimeGaps
Description copied from interface:IXYTimeSeriesPlotBuilder
Toggle whether to show time gaps at x-values where there is no corresponding time instance.- Specified by:
showTimeGaps
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
showTimeGaps
- True to show time gaps, false otherwise.- Returns:
- Reference to this builder instance for method chaining
-
series
Description copied from interface:IXYTimeSeriesPlotBuilder
Registers an IXYTimeSeriesBuilder whosebuild()
method will be called to generate its XYTimeSeries when this plot builder'sbuild()
method is called.- Specified by:
series
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
series
- The series builder representing the series that it will build- Returns:
- Reference to this builder instance for method chaining
-
series
Description copied from interface:IXYTimeSeriesPlotBuilder
Registers an IXYDatasetBuilder whosebuild()
method will be called to generate its XYDataset when this plot builder'sbuild()
method is called.- Specified by:
series
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
dataset
- The series builder representing the series that it will build- Returns:
- Reference to this builder instance for method chaining
-
marker
Description copied from interface:IXYTimeSeriesPlotBuilder
Registers aMarkerBuilder
whosebuild()
method will be called to generate its plot line when this plot builder'sbuild()
method is called.- Specified by:
marker
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
line
- The marker builder representing the marker that it will build- Returns:
- Reference to this builder instance for method chaining
-
annotation
Description copied from interface:IXYTimeSeriesPlotBuilder
Registers an IXYAnnotationBuilder whosebuild()
method will be called to generate its XYAnnotation when this plot builder'sbuild()
method is called.- Specified by:
annotation
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
annotation
- The annotation builder representing the annotation that it will build- Returns:
- Reference to this builder instance for method chaining
-
plotWeight
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets the plot weight to be attributed to the plot. A default of 1 will be used if this is not set.- Specified by:
plotWeight
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
weight
- The plot weight to be set- Returns:
- Reference to this builder instance for method chaining
-
plotWeight
public int plotWeight()Description copied from interface:IXYTimeSeriesPlotBuilder
Gets the currently configured plot weight.- Specified by:
plotWeight
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Returns:
- The plot weight
-
yAxisName
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets the plot's y-axis name.- Specified by:
yAxisName
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
name
- The axis name to be set- Returns:
- Reference to this builder instance for method chaining
-
yAxisRange
public XYTimeSeriesPlotBuilder yAxisRange(double lower, double upper) throws IllegalArgumentException Description copied from interface:IXYTimeSeriesPlotBuilder
Sets an explicit y-axis value range to use instead of having the y-axis auto-calculate it.- Specified by:
yAxisRange
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
lower
- The lower bound to be setupper
- The upper bound to be set- Returns:
- Reference to this builder instance for method chaining
- Throws:
IllegalArgumentException
- If the lower bound is greater than the upper one
-
yAxisTickSize
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets the plot's y-axis tick size.- Specified by:
yAxisTickSize
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
size
- The tick size to be set- Returns:
- Reference to this builder instance for method chaining
-
yTickFormat
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets the plot's y-axis tick format.- Specified by:
yTickFormat
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
format
- The tick format to be set- Returns:
- Reference to this builder instance for method chaining
-
backgroundColor
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets the plot background color to use when building the plot.- Specified by:
backgroundColor
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
color
- The color to set- Returns:
- Reference to this builder instance for method chaining
-
axisFontColor
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets the axis font color to use when building the plot.- Specified by:
axisFontColor
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
color
- The color to set- Returns:
- Reference to this builder instance for method chaining
-
axisColor
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets the axis color to use when building the plot.- Specified by:
axisColor
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
color
- The color to set- Returns:
- Reference to this builder instance for method chaining
-
gridLines
Deprecated.This facility is replaced bymajorGrid(boolean)
andminorGrid(boolean)
, and will be removed in a future release.For removal since v1.5.7
Sets displaying grid lines ON.- Specified by:
gridLines
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Returns:
- Reference to this builder instance for method chaining
-
noGridLines
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets displaying all grid lines OFF. Shorthand for calling bothIXYTimeSeriesPlotBuilder.majorGrid(boolean)
andIXYTimeSeriesPlotBuilder.minorGrid(boolean)
with a value offalse
.- Specified by:
noGridLines
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Returns:
- Reference to this builder instance for method chaining
-
majorGrid
Description copied from interface:IXYTimeSeriesPlotBuilder
Toggles displaying major grid lines ON or OFF.- Specified by:
majorGrid
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
enabled
- True to show major grid lines, false to turn them off.- Returns:
- Reference to this builder instance for method chaining
-
majorGridColor
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets the major grid color to use when building the plot.- Specified by:
majorGridColor
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
color
- The color to set- Returns:
- Reference to this builder instance for method chaining
-
majorGridStyle
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets the major grid line style to use when building the plot.- Specified by:
majorGridStyle
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
style
- The style to set- Returns:
- Reference to this builder instance for method chaining
-
minorGrid
Description copied from interface:IXYTimeSeriesPlotBuilder
Toggles displaying minor grid lines ON or OFF.- Specified by:
minorGrid
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
enabled
- True to show minor grid lines, false to turn them off.- Returns:
- Reference to this builder instance for method chaining
-
minorGridColor
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets the minor grid color to use when building the plot.- Specified by:
minorGridColor
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
color
- The color to set- Returns:
- Reference to this builder instance for method chaining
-
minorGridStyle
Description copied from interface:IXYTimeSeriesPlotBuilder
Sets the minor grid line style to use when building the plot.- Specified by:
minorGridStyle
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Parameters:
style
- The style to set- Returns:
- Reference to this builder instance for method chaining
-
build
Description copied from interface:IXYTimeSeriesPlotBuilder
Builds the XYPlot from all configured data and properties.- Specified by:
build
in interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>
- Returns:
- New instance of an XYPlot corresponding to all configured data and properties
- Throws:
IllegalStateException
- If the minimum needed configuration for building an XYPlot is not setup in the builder.
-
majorGrid(boolean)
andminorGrid(boolean)
, and will be removed in a future release.