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.XYPlotbuild()Builds the XYPlot from all configured data and properties.static XYTimeSeriesPlotBuilderget()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 aMarkerBuilderwhosebuild()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.intGets 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:IXYTimeSeriesPlotBuilderSets 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:
indexRangein interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>- Parameters:
indexRange- The index range to be set- Returns:
- Reference to this builder instance for method chaining
-
xAxis
Description copied from interface:IXYTimeSeriesPlotBuilderSets the x-axis used when building the plot.- Specified by:
xAxisin interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>- Parameters:
xAxis- The axis to be set- Returns:
- Reference to this builder instance for method chaining
-
timeData
Description copied from interface:IXYTimeSeriesPlotBuilderSets the date-time values to be used when building the plot.- Specified by:
timeDatain 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:IXYTimeSeriesPlotBuilderToggle whether to show time gaps at x-values where there is no corresponding time instance.- Specified by:
showTimeGapsin 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:IXYTimeSeriesPlotBuilderRegisters an IXYTimeSeriesBuilder whosebuild()method will be called to generate its XYTimeSeries when this plot builder'sbuild()method is called.- Specified by:
seriesin 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:IXYTimeSeriesPlotBuilderRegisters an IXYDatasetBuilder whosebuild()method will be called to generate its XYDataset when this plot builder'sbuild()method is called.- Specified by:
seriesin 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:IXYTimeSeriesPlotBuilderRegisters aMarkerBuilderwhosebuild()method will be called to generate its plot line when this plot builder'sbuild()method is called.- Specified by:
markerin 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:IXYTimeSeriesPlotBuilderRegisters an IXYAnnotationBuilder whosebuild()method will be called to generate its XYAnnotation when this plot builder'sbuild()method is called.- Specified by:
annotationin 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:IXYTimeSeriesPlotBuilderSets the plot weight to be attributed to the plot. A default of 1 will be used if this is not set.- Specified by:
plotWeightin 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:IXYTimeSeriesPlotBuilderGets the currently configured plot weight.- Specified by:
plotWeightin interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>- Returns:
- The plot weight
-
yAxisName
Description copied from interface:IXYTimeSeriesPlotBuilderSets the plot's y-axis name.- Specified by:
yAxisNamein 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:IXYTimeSeriesPlotBuilderSets an explicit y-axis value range to use instead of having the y-axis auto-calculate it.- Specified by:
yAxisRangein 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:IXYTimeSeriesPlotBuilderSets the plot's y-axis tick size.- Specified by:
yAxisTickSizein interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>- Parameters:
size- The tick size to be set- Returns:
- Reference to this builder instance for method chaining
-
yTickFormat
Description copied from interface:IXYTimeSeriesPlotBuilderSets the plot's y-axis tick format.- Specified by:
yTickFormatin interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>- Parameters:
format- The tick format to be set- Returns:
- Reference to this builder instance for method chaining
-
backgroundColor
Description copied from interface:IXYTimeSeriesPlotBuilderSets the plot background color to use when building the plot.- Specified by:
backgroundColorin interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>- Parameters:
color- The color to set- Returns:
- Reference to this builder instance for method chaining
-
axisFontColor
Description copied from interface:IXYTimeSeriesPlotBuilderSets the axis font color to use when building the plot.- Specified by:
axisFontColorin interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>- Parameters:
color- The color to set- Returns:
- Reference to this builder instance for method chaining
-
axisColor
Description copied from interface:IXYTimeSeriesPlotBuilderSets the axis color to use when building the plot.- Specified by:
axisColorin 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:
gridLinesin interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>- Returns:
- Reference to this builder instance for method chaining
-
noGridLines
Description copied from interface:IXYTimeSeriesPlotBuilderSets displaying all grid lines OFF. Shorthand for calling bothIXYTimeSeriesPlotBuilder.majorGrid(boolean)andIXYTimeSeriesPlotBuilder.minorGrid(boolean)with a value offalse.- Specified by:
noGridLinesin interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>- Returns:
- Reference to this builder instance for method chaining
-
majorGrid
Description copied from interface:IXYTimeSeriesPlotBuilderToggles displaying major grid lines ON or OFF.- Specified by:
majorGridin 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:IXYTimeSeriesPlotBuilderSets the major grid color to use when building the plot.- Specified by:
majorGridColorin interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>- Parameters:
color- The color to set- Returns:
- Reference to this builder instance for method chaining
-
majorGridStyle
Description copied from interface:IXYTimeSeriesPlotBuilderSets the major grid line style to use when building the plot.- Specified by:
majorGridStylein interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>- Parameters:
style- The style to set- Returns:
- Reference to this builder instance for method chaining
-
minorGrid
Description copied from interface:IXYTimeSeriesPlotBuilderToggles displaying minor grid lines ON or OFF.- Specified by:
minorGridin 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:IXYTimeSeriesPlotBuilderSets the minor grid color to use when building the plot.- Specified by:
minorGridColorin interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>- Parameters:
color- The color to set- Returns:
- Reference to this builder instance for method chaining
-
minorGridStyle
Description copied from interface:IXYTimeSeriesPlotBuilderSets the minor grid line style to use when building the plot.- Specified by:
minorGridStylein interfaceIXYTimeSeriesPlotBuilder<XYTimeSeriesPlotBuilder>- Parameters:
style- The style to set- Returns:
- Reference to this builder instance for method chaining
-
build
Description copied from interface:IXYTimeSeriesPlotBuilderBuilds the XYPlot from all configured data and properties.- Specified by:
buildin 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.