SubseriesPlot STATBEAN®

 

Purpose: Displays seasonal time series data in several formats. 

Time Series Data Visualization DataSource: any. 

subseriesplot


Time Series Data Visualization Read/Write Properties
Name Type Description Possible Values Default Value
plotType String Format of plot. "Annual","Cumulative",
"Seasonal","Vertical"
"Vertical"
samplingInterval double The length of time between consecutive data values. Any double > 0.0 1.0
seasonalLength int The number of time periods comprising a season. 1+ 1
startTime String The value of time associated with row 1. Any string resulting in the proper type of value. "1.0"
timeScale String The type of time units. "Year","Quarter","Month","Day",
"Hour","Minute","Second","Other"
"Other"
timeSeriesVariableName String The name of the column with data values to be plotted. Any string. ""

Other properties for time series data visualization are inherited from the java.awt.Canvas class and from the general GraphicalStatbean class.

Code Sample 

//create a datasource bean 
FileDataSource fileDataSource1 = new STATBEANS.FileDataSource(); 

//set the file name to be read 
fileDataSource1.setFileName("c:\\statbeans\\samples\\bridge.txt"); 

//create a plot bean 
SubseriesPlot plot1 = new STATBEANS.SubseriesPlot(); 

//set the variable name for plotting 
plot1.setTimeSeriesVariableName("traffic"); 

//set the axis scaling 
plot1.setTimeScale("month"); 
plot1.setStartTime("1/71"); 

//set the plot type 
plot1.setPlotType("Annual"); 

//set the legend position 
plot1.setLegendHorizontalPosition(1.1); 
plot1.setLegendVerticalPosition(1.2); 

//override a default color 
plot1.setLineColors(Color.red,12); 
plot1.setPointColors(Color.red,12); 

//add the plot to the application frame 
add(plot1); 

//make the plot bean a listener for changes in the FileDataSource bean 
fileDataSource1.addDataChangeListener(plot1.listenerForDataChange); 

//instruct the fileDataSource bean to read the file 
fileDataSource1.readData();