StatBean Name: SubseriesPlot

Purpose: Displays seasonal time series data in several formats.

DataSource: any.


Read/Write Properties
NameTypeDescriptionPossible ValuesDefault Value
plotTypeStringFormat of plot."Annual","Cumulative",
"Seasonal","Vertical"
"Vertical"
samplingIntervaldoubleThe length of time between consecutive data values.Any double > 0.01.0
seasonalLengthintThe number of time periods comprising a season.1+1
startTimeStringThe value of time associated with row 1.Any string resulting in the proper type of value."1.0"
timeScaleStringThe type of time units."Year","Quarter","Month","Day",
"Hour","Minute","Second","Other"
"Other"
timeSeriesVariableNameStringThe name of the column with data values to be plotted.Any string.""

Other properties 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();