Package repast.simphony.chart2.engine
Class TimeSeriesChartDescriptor
- java.lang.Object
-
- repast.simphony.scenario.AbstractDescriptor
-
- repast.simphony.chart2.engine.ChartDescriptor
-
- repast.simphony.chart2.engine.TimeSeriesChartDescriptor
-
- All Implemented Interfaces:
Descriptor
public class TimeSeriesChartDescriptor extends ChartDescriptor
ChartDescriptor for TimeSeries type charts where tick is the time value. This descriptor can provide metadata for aggregate type time series where each column of data is a series (e.g. "Agent Count") or non-aggregate time series where each unique value of some data column becomes a series (e.g. "Agent Id", and the data is the value of the dataValueId passed in the constructor.- Author:
- Nick Collier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
TimeSeriesChartDescriptor.SeriesData
-
Nested classes/interfaces inherited from class repast.simphony.chart2.engine.ChartDescriptor
ChartDescriptor.ChartType
-
-
Field Summary
-
Fields inherited from class repast.simphony.chart2.engine.ChartDescriptor
background, chartTitle, dataSet, gridLineColor, showGrid, showLegend, type, xAxisLabel, yAxisLabel
-
Fields inherited from class repast.simphony.scenario.AbstractDescriptor
scs
-
-
Constructor Summary
Constructors Constructor Description TimeSeriesChartDescriptor(String name)
TimeSeriesChartDescriptor(String name, String dataValueId)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDataValueId(String dataValueId)
Adds the id of a data source to record as a series.void
addSeriesId(String id, String label, Color color)
Adds the id of a data source to record as a series.void
clearSeriesIds()
Clears the series data in this descriptor.Iterable<String>
dataValueIds()
Gets an iterable over the data value ids.String
getDataValueId()
Gets the id of the data source used to provide the data for the time series.int
getPlotRangeLength()
Color
getSeriesColor(String seriesId)
Gets the color of the specified series.List<String>
getSeriesIds()
Gets a list of the data source ids to use as series in the chart.String
getSeriesLabel(String seriesId)
Gets the label for the specified series.void
setDataValueId(String dataValueId)
Sets the id of the data source used to provide the data for the time series.void
setPlotRangeLength(int plotRangeLength)
-
Methods inherited from class repast.simphony.chart2.engine.ChartDescriptor
doShowLegend, getBackground, getChartTitle, getDataSet, getGridLineColor, getXAxisLabel, getYAxisLabel, isShowGrid, setBackground, setChartTitle, setDataSet, setGridLineColor, setShowGrid, setShowLegend, setXAxisLabel, setYAxisLabel
-
Methods inherited from class repast.simphony.scenario.AbstractDescriptor
addScenarioChangedListener, getName, readResolve, setName
-
-
-
-
Method Detail
-
getPlotRangeLength
public int getPlotRangeLength()
- Returns:
- the plotRangeLength
-
setPlotRangeLength
public void setPlotRangeLength(int plotRangeLength)
- Parameters:
plotRangeLength
- the plotRangeLength to set
-
getDataValueId
public String getDataValueId()
Gets the id of the data source used to provide the data for the time series. This is only applicable for time series of non-aggregate data.- Returns:
- the id of the data source used to provide the data for the time series.
-
setDataValueId
public void setDataValueId(String dataValueId)
Sets the id of the data source used to provide the data for the time series. This is only applicable for time series of non-aggregate data. param dataValueId the id of the data source used to provide the data for the time series
-
addSeriesId
public void addSeriesId(String id, String label, Color color)
Adds the id of a data source to record as a series.- Parameters:
id
-label
- the chart series label for this id
-
addDataValueId
public void addDataValueId(String dataValueId)
Adds the id of a data source to record as a series.
-
dataValueIds
public Iterable<String> dataValueIds()
Gets an iterable over the data value ids.- Returns:
-
clearSeriesIds
public void clearSeriesIds()
Clears the series data in this descriptor.
-
getSeriesIds
public List<String> getSeriesIds()
Gets a list of the data source ids to use as series in the chart.- Returns:
- a list of the data source ids to use as series in the chart.
-
getSeriesLabel
public String getSeriesLabel(String seriesId)
Gets the label for the specified series.- Parameters:
seriesId
-- Returns:
- the label for the specified series.
-
-