public class ChartUtilities
extends java.lang.Object
In your init() method, you will create a chart by calling one of the build...Generator(...) methods. Then you will create one or more series by calling one of the add...Series(...) methods.
Store the series you created in instance variables.
Finally, in your start() and load() methods (perhaps in setupPortrayals() if both of them call that method), you will schedule each of the series by calling the schedule...Series(...) methods.
The ChartUtilities schedule...Series(...) methods expect a "value provider" object which implements one of the ChartUtilities.Provides... interfaces. This object is called each timestep to add new data (for ProvidesDoubles) or replace all the data (for the other Provides interfaces) in the chart before the chart is redrawn. You can pass in null for this object, which prevents the data from ever being updated; in this case it's up to you to update the data on your own.
Modifier and Type | Class and Description |
---|---|
static interface |
ChartUtilities.ProvidesCollection
This class provides Collections of Objects to chart, or provides null if the current charted values shouldn't be changed.
|
static interface |
ChartUtilities.ProvidesDoubleDoubles
This class provides two double arrays (that is, an array of the form double[2][]), which are
the same length, which represent the x and y coordinates of points, or else
provides null if the current charted values shouldn't be changed.
|
static interface |
ChartUtilities.ProvidesDoubleDoublesAndLabels
This class provides arrays of arrays of doubles to chart, plus one label for each of the arrays,
or provides null if the current charted values shouldn't be changed.
|
static interface |
ChartUtilities.ProvidesDoubles
This class provides arrays of doubles to chart, or provides null if the current charted values shouldn't be changed.
|
static interface |
ChartUtilities.ProvidesDoublesAndLabels
This class provides arrays of doubles to chart, with associated labels, or provides null if the current charted values shouldn't be changed.
|
static interface |
ChartUtilities.ProvidesObjects
This class provides arrays of Objects to chart, or provides null if the current charted values shouldn't be changed.
|
static interface |
ChartUtilities.ProvidesTripleDoubles
This class provides three double arrays (that is, an array of the form double[3][]), which are
the same length, which represent the x, y, and z coordinates of points, or else
provides null if the current charted values shouldn't be changed.
|
Constructor and Description |
---|
ChartUtilities() |
Modifier and Type | Method and Description |
---|---|
static BarChartSeriesAttributes |
addSeries(BarChartGenerator chart,
java.lang.String seriesName)
Adds a series to the BarChartGenerator.
|
static BoxPlotSeriesAttributes |
addSeries(BoxPlotGenerator chart,
java.lang.String seriesName)
Adds a series to the BoxPlotGenerator.
|
static BubbleChartSeriesAttributes |
addSeries(BubbleChartGenerator chart,
java.lang.String seriesName)
Adds a series to the BubbleChartGenerator.
|
static HistogramSeriesAttributes |
addSeries(HistogramGenerator chart,
java.lang.String seriesName,
int bins)
Adds a series to the HistogramGenerator.
|
static PieChartSeriesAttributes |
addSeries(PieChartGenerator chart,
java.lang.String seriesName)
Adds a series to the PieChartGenerator.
|
static ScatterPlotSeriesAttributes |
addSeries(ScatterPlotGenerator chart,
java.lang.String seriesName)
Adds a series to the ScatterPlotGenerator.
|
static TimeSeriesAttributes |
addSeries(TimeSeriesChartGenerator chart,
java.lang.String seriesName)
Adds a series to the TimeSeriesChartGenerator
|
static BarChartGenerator |
buildBarChartGenerator(GUIState state,
java.lang.String title)
Builds a BarChartGenerator and attaches it as a display in a MASON simulation.
|
static BarChartGenerator |
buildBarChartGenerator(java.lang.String title)
Builds a BarChartGenerator not attached to any MASON simulation.
|
static BoxPlotGenerator |
buildBoxPlotGenerator(GUIState state,
java.lang.String title,
java.lang.String rangeAxisLabel)
Builds a BoxPlotGenerator and attaches it as a display in a MASON simulation.
|
static BoxPlotGenerator |
buildBoxPlotGenerator(java.lang.String title,
java.lang.String rangeAxisLabel)
Builds a BoxPlotGenerator not attached to any MASON simulation.
|
static BubbleChartGenerator |
buildBubbleChartGenerator(GUIState state,
java.lang.String title,
java.lang.String rangeAxisLabel,
java.lang.String domainAxisLabel)
Builds a BubbleChartGenerator and attaches it as a display in a MASON simulation.
|
static BubbleChartGenerator |
buildBubbleChartGenerator(java.lang.String title,
java.lang.String rangeAxisLabel,
java.lang.String domainAxisLabel)
Builds a BubbleChartGenerator not attached to any MASON simulation.
|
static HistogramGenerator |
buildHistogramGenerator(GUIState state,
java.lang.String title,
java.lang.String rangeAxisLabel)
Builds a HistogramGenerator and attaches it as a display in a MASON simulation.
|
static HistogramGenerator |
buildHistogramGenerator(java.lang.String title,
java.lang.String rangeAxisLabel)
Builds a HistogramGenerator not attached to any MASON simulation.
|
static PieChartGenerator |
buildPieChartGenerator(GUIState state,
java.lang.String title)
Builds a PieChartGenerator and attaches it as a display in a MASON simulation.
|
static PieChartGenerator |
buildPieChartGenerator(java.lang.String title)
Builds a PieChartGenerator not attached to any MASON simulation.
|
static ScatterPlotGenerator |
buildScatterPlotGenerator(GUIState state,
java.lang.String title,
java.lang.String rangeAxisLabel,
java.lang.String domainAxisLabel)
Builds a ScatterPlotGenerator and attaches it as a display in a MASON simulation.
|
static ScatterPlotGenerator |
buildScatterPlotGenerator(java.lang.String title,
java.lang.String rangeAxisLabel,
java.lang.String domainAxisLabel)
Builds a ScatterPlotGenerator not attached to any MASON simulation.
|
static TimeSeriesChartGenerator |
buildTimeSeriesChartGenerator(GUIState state,
java.lang.String title,
java.lang.String domainAxisLabel)
Builds a TimeSeriesChartGenerator and attaches it as a display in a MASON simulation.
|
static TimeSeriesChartGenerator |
buildTimeSeriesChartGenerator(java.lang.String title,
java.lang.String domainAxisLabel)
Builds a TimeSeriesChartGenerator not attached to any MASON simulation.
|
static Stoppable |
scheduleSeries(GUIState state,
BarChartSeriesAttributes attributes,
ChartUtilities.ProvidesCollection valueProvider)
Schedules a series with the MASON simulation.
|
static Stoppable |
scheduleSeries(GUIState state,
BarChartSeriesAttributes attributes,
ChartUtilities.ProvidesDoublesAndLabels valueProvider)
Schedules a series with the MASON simulation.
|
static Stoppable |
scheduleSeries(GUIState state,
BarChartSeriesAttributes attributes,
ChartUtilities.ProvidesObjects valueProvider)
Schedules a series with the MASON simulation.
|
static Stoppable |
scheduleSeries(GUIState state,
BoxPlotSeriesAttributes attributes,
ChartUtilities.ProvidesDoubleDoublesAndLabels valueProvider)
Schedules a series with the MASON simulation.
|
static Stoppable |
scheduleSeries(GUIState state,
BoxPlotSeriesAttributes attributes,
ChartUtilities.ProvidesDoubles valueProvider)
Schedules a series with the MASON simulation.
|
static Stoppable |
scheduleSeries(GUIState state,
BubbleChartSeriesAttributes attributes,
ChartUtilities.ProvidesTripleDoubles valueProvider)
Schedules a series with the MASON simulation.
|
static Stoppable |
scheduleSeries(GUIState state,
HistogramSeriesAttributes attributes,
ChartUtilities.ProvidesDoubles valueProvider)
Schedules a series with the MASON simulation.
|
static Stoppable |
scheduleSeries(GUIState state,
PieChartSeriesAttributes attributes,
ChartUtilities.ProvidesCollection valueProvider)
Schedules a series with the MASON simulation.
|
static Stoppable |
scheduleSeries(GUIState state,
PieChartSeriesAttributes attributes,
ChartUtilities.ProvidesDoublesAndLabels valueProvider)
Schedules a series with the MASON simulation.
|
static Stoppable |
scheduleSeries(GUIState state,
PieChartSeriesAttributes attributes,
ChartUtilities.ProvidesObjects valueProvider)
Schedules a series with the MASON simulation.
|
static Stoppable |
scheduleSeries(GUIState state,
ScatterPlotSeriesAttributes attributes,
ChartUtilities.ProvidesDoubleDoubles valueProvider)
Schedules a series with the MASON simulation.
|
static Stoppable |
scheduleSeries(GUIState state,
TimeSeriesAttributes attributes,
Valuable valueProvider)
Schedules a series with the MASON simulation.
|
public static TimeSeriesChartGenerator buildTimeSeriesChartGenerator(java.lang.String title, java.lang.String domainAxisLabel)
public static TimeSeriesChartGenerator buildTimeSeriesChartGenerator(GUIState state, java.lang.String title, java.lang.String domainAxisLabel)
public static TimeSeriesAttributes addSeries(TimeSeriesChartGenerator chart, java.lang.String seriesName)
public static Stoppable scheduleSeries(GUIState state, TimeSeriesAttributes attributes, Valuable valueProvider)
public static HistogramGenerator buildHistogramGenerator(java.lang.String title, java.lang.String rangeAxisLabel)
public static HistogramGenerator buildHistogramGenerator(GUIState state, java.lang.String title, java.lang.String rangeAxisLabel)
public static HistogramSeriesAttributes addSeries(HistogramGenerator chart, java.lang.String seriesName, int bins)
public static Stoppable scheduleSeries(GUIState state, HistogramSeriesAttributes attributes, ChartUtilities.ProvidesDoubles valueProvider)
public static BoxPlotGenerator buildBoxPlotGenerator(java.lang.String title, java.lang.String rangeAxisLabel)
public static BoxPlotGenerator buildBoxPlotGenerator(GUIState state, java.lang.String title, java.lang.String rangeAxisLabel)
public static BoxPlotSeriesAttributes addSeries(BoxPlotGenerator chart, java.lang.String seriesName)
public static Stoppable scheduleSeries(GUIState state, BoxPlotSeriesAttributes attributes, ChartUtilities.ProvidesDoubles valueProvider)
public static Stoppable scheduleSeries(GUIState state, BoxPlotSeriesAttributes attributes, ChartUtilities.ProvidesDoubleDoublesAndLabels valueProvider)
public static ScatterPlotGenerator buildScatterPlotGenerator(java.lang.String title, java.lang.String rangeAxisLabel, java.lang.String domainAxisLabel)
public static ScatterPlotGenerator buildScatterPlotGenerator(GUIState state, java.lang.String title, java.lang.String rangeAxisLabel, java.lang.String domainAxisLabel)
public static ScatterPlotSeriesAttributes addSeries(ScatterPlotGenerator chart, java.lang.String seriesName)
public static Stoppable scheduleSeries(GUIState state, ScatterPlotSeriesAttributes attributes, ChartUtilities.ProvidesDoubleDoubles valueProvider)
public static BubbleChartGenerator buildBubbleChartGenerator(java.lang.String title, java.lang.String rangeAxisLabel, java.lang.String domainAxisLabel)
public static BubbleChartGenerator buildBubbleChartGenerator(GUIState state, java.lang.String title, java.lang.String rangeAxisLabel, java.lang.String domainAxisLabel)
public static BubbleChartSeriesAttributes addSeries(BubbleChartGenerator chart, java.lang.String seriesName)
public static Stoppable scheduleSeries(GUIState state, BubbleChartSeriesAttributes attributes, ChartUtilities.ProvidesTripleDoubles valueProvider)
public static PieChartGenerator buildPieChartGenerator(java.lang.String title)
public static PieChartGenerator buildPieChartGenerator(GUIState state, java.lang.String title)
public static PieChartSeriesAttributes addSeries(PieChartGenerator chart, java.lang.String seriesName)
public static Stoppable scheduleSeries(GUIState state, PieChartSeriesAttributes attributes, ChartUtilities.ProvidesDoublesAndLabels valueProvider)
public static Stoppable scheduleSeries(GUIState state, PieChartSeriesAttributes attributes, ChartUtilities.ProvidesObjects valueProvider)
public static Stoppable scheduleSeries(GUIState state, PieChartSeriesAttributes attributes, ChartUtilities.ProvidesCollection valueProvider)
public static BarChartGenerator buildBarChartGenerator(java.lang.String title)
public static BarChartGenerator buildBarChartGenerator(GUIState state, java.lang.String title)
public static BarChartSeriesAttributes addSeries(BarChartGenerator chart, java.lang.String seriesName)
public static Stoppable scheduleSeries(GUIState state, BarChartSeriesAttributes attributes, ChartUtilities.ProvidesDoublesAndLabels valueProvider)
public static Stoppable scheduleSeries(GUIState state, BarChartSeriesAttributes attributes, ChartUtilities.ProvidesObjects valueProvider)
public static Stoppable scheduleSeries(GUIState state, BarChartSeriesAttributes attributes, ChartUtilities.ProvidesCollection valueProvider)