Class ChartUtilities
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.
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
This class provides Collections of Objects to chart, or provides null if the current charted values shouldn't be changed.static interface
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
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
This class provides arrays of doubles to chart, or provides null if the current charted values shouldn't be changed.static interface
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
This class provides arrays of Objects to chart, or provides null if the current charted values shouldn't be changed.static interface
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 Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic BarChartSeriesAttributes
addSeries
(BarChartGenerator chart, String seriesName) Adds a series to the BarChartGenerator.static BoxPlotSeriesAttributes
addSeries
(BoxPlotGenerator chart, String seriesName) Adds a series to the BoxPlotGenerator.static BubbleChartSeriesAttributes
addSeries
(BubbleChartGenerator chart, String seriesName) Adds a series to the BubbleChartGenerator.static HistogramSeriesAttributes
addSeries
(HistogramGenerator chart, String seriesName, int bins) Adds a series to the HistogramGenerator.static PieChartSeriesAttributes
addSeries
(PieChartGenerator chart, String seriesName) Adds a series to the PieChartGenerator.static ScatterPlotSeriesAttributes
addSeries
(ScatterPlotGenerator chart, String seriesName) Adds a series to the ScatterPlotGenerator.static TimeSeriesAttributes
addSeries
(TimeSeriesChartGenerator chart, String seriesName) Adds a series to the TimeSeriesChartGeneratorstatic BarChartGenerator
buildBarChartGenerator
(String title) Builds a BarChartGenerator not attached to any MASON simulation.static BarChartGenerator
buildBarChartGenerator
(GUIState state, String title) Builds a BarChartGenerator and attaches it as a display in a MASON simulation.static BoxPlotGenerator
buildBoxPlotGenerator
(String title, String rangeAxisLabel) Builds a BoxPlotGenerator not attached to any MASON simulation.static BoxPlotGenerator
buildBoxPlotGenerator
(GUIState state, String title, String rangeAxisLabel) Builds a BoxPlotGenerator and attaches it as a display in a MASON simulation.static BubbleChartGenerator
buildBubbleChartGenerator
(String title, String rangeAxisLabel, String domainAxisLabel) Builds a BubbleChartGenerator not attached to any MASON simulation.static BubbleChartGenerator
buildBubbleChartGenerator
(GUIState state, String title, String rangeAxisLabel, String domainAxisLabel) Builds a BubbleChartGenerator and attaches it as a display in a MASON simulation.static HistogramGenerator
buildHistogramGenerator
(String title, String rangeAxisLabel) Builds a HistogramGenerator not attached to any MASON simulation.static HistogramGenerator
buildHistogramGenerator
(GUIState state, String title, String rangeAxisLabel) Builds a HistogramGenerator and attaches it as a display in a MASON simulation.static PieChartGenerator
buildPieChartGenerator
(String title) Builds a PieChartGenerator not attached to any MASON simulation.static PieChartGenerator
buildPieChartGenerator
(GUIState state, String title) Builds a PieChartGenerator and attaches it as a display in a MASON simulation.static ScatterPlotGenerator
buildScatterPlotGenerator
(String title, String rangeAxisLabel, String domainAxisLabel) Builds a ScatterPlotGenerator not attached to any MASON simulation.static ScatterPlotGenerator
buildScatterPlotGenerator
(GUIState state, String title, String rangeAxisLabel, String domainAxisLabel) Builds a ScatterPlotGenerator and attaches it as a display in a MASON simulation.static TimeSeriesChartGenerator
buildTimeSeriesChartGenerator
(String title, String domainAxisLabel) Builds a TimeSeriesChartGenerator not attached to any MASON simulation.static TimeSeriesChartGenerator
buildTimeSeriesChartGenerator
(GUIState state, String title, String domainAxisLabel) Builds a TimeSeriesChartGenerator and attaches it as a display in a 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.
-
Constructor Details
-
ChartUtilities
public ChartUtilities()
-
-
Method Details
-
buildTimeSeriesChartGenerator
public static TimeSeriesChartGenerator buildTimeSeriesChartGenerator(String title, String domainAxisLabel) Builds a TimeSeriesChartGenerator not attached to any MASON simulation. -
buildTimeSeriesChartGenerator
public static TimeSeriesChartGenerator buildTimeSeriesChartGenerator(GUIState state, String title, String domainAxisLabel) Builds a TimeSeriesChartGenerator and attaches it as a display in a MASON simulation. -
addSeries
Adds a series to the TimeSeriesChartGenerator -
scheduleSeries
public static Stoppable scheduleSeries(GUIState state, TimeSeriesAttributes attributes, Valuable valueProvider) Schedules a series with the MASON simulation. You specify a value provider to give series data each timestep. This value provider can be null, in which case no data will ever be updated -- you'd have to update it on your own as you saw fit. -
buildHistogramGenerator
Builds a HistogramGenerator not attached to any MASON simulation. -
buildHistogramGenerator
public static HistogramGenerator buildHistogramGenerator(GUIState state, String title, String rangeAxisLabel) Builds a HistogramGenerator and attaches it as a display in a MASON simulation. -
addSeries
public static HistogramSeriesAttributes addSeries(HistogramGenerator chart, String seriesName, int bins) Adds a series to the HistogramGenerator. You also provide the default number of histogram bins. -
scheduleSeries
public static Stoppable scheduleSeries(GUIState state, HistogramSeriesAttributes attributes, ChartUtilities.ProvidesDoubles valueProvider) Schedules a series with the MASON simulation. You specify a value provider to give series data each timestep. This value provider can be null, in which case no data will ever be updated -- you'd have to update it on your own as you saw fit. -
buildBoxPlotGenerator
Builds a BoxPlotGenerator not attached to any MASON simulation. -
buildBoxPlotGenerator
public static BoxPlotGenerator buildBoxPlotGenerator(GUIState state, String title, String rangeAxisLabel) Builds a BoxPlotGenerator and attaches it as a display in a MASON simulation. -
addSeries
Adds a series to the BoxPlotGenerator. -
scheduleSeries
public static Stoppable scheduleSeries(GUIState state, BoxPlotSeriesAttributes attributes, ChartUtilities.ProvidesDoubles valueProvider) Schedules a series with the MASON simulation. You specify a value provider to give series data each timestep. This value provider can be null, in which case no data will ever be updated -- you'd have to update it on your own as you saw fit. -
scheduleSeries
public static Stoppable scheduleSeries(GUIState state, BoxPlotSeriesAttributes attributes, ChartUtilities.ProvidesDoubleDoublesAndLabels valueProvider) Schedules a series with the MASON simulation. You specify a value provider to give series data each timestep. This value provider can be null, in which case no data will ever be updated -- you'd have to update it on your own as you saw fit. -
buildScatterPlotGenerator
public static ScatterPlotGenerator buildScatterPlotGenerator(String title, String rangeAxisLabel, String domainAxisLabel) Builds a ScatterPlotGenerator not attached to any MASON simulation. -
buildScatterPlotGenerator
public static ScatterPlotGenerator buildScatterPlotGenerator(GUIState state, String title, String rangeAxisLabel, String domainAxisLabel) Builds a ScatterPlotGenerator and attaches it as a display in a MASON simulation. -
addSeries
Adds a series to the ScatterPlotGenerator. -
scheduleSeries
public static Stoppable scheduleSeries(GUIState state, ScatterPlotSeriesAttributes attributes, ChartUtilities.ProvidesDoubleDoubles valueProvider) Schedules a series with the MASON simulation. You specify a value provider to give series data each timestep. This value provider can be null, in which case no data will ever be updated -- you'd have to update it on your own as you saw fit. -
buildBubbleChartGenerator
public static BubbleChartGenerator buildBubbleChartGenerator(String title, String rangeAxisLabel, String domainAxisLabel) Builds a BubbleChartGenerator not attached to any MASON simulation. -
buildBubbleChartGenerator
public static BubbleChartGenerator buildBubbleChartGenerator(GUIState state, String title, String rangeAxisLabel, String domainAxisLabel) Builds a BubbleChartGenerator and attaches it as a display in a MASON simulation. -
addSeries
Adds a series to the BubbleChartGenerator. -
scheduleSeries
public static Stoppable scheduleSeries(GUIState state, BubbleChartSeriesAttributes attributes, ChartUtilities.ProvidesTripleDoubles valueProvider) Schedules a series with the MASON simulation. You specify a value provider to give series data each timestep. This value provider can be null, in which case no data will ever be updated -- you'd have to update it on your own as you saw fit. -
buildPieChartGenerator
Builds a PieChartGenerator not attached to any MASON simulation. -
buildPieChartGenerator
Builds a PieChartGenerator and attaches it as a display in a MASON simulation. -
addSeries
Adds a series to the PieChartGenerator. -
scheduleSeries
public static Stoppable scheduleSeries(GUIState state, PieChartSeriesAttributes attributes, ChartUtilities.ProvidesDoublesAndLabels valueProvider) Schedules a series with the MASON simulation. You specify a value provider to give series data each timestep. This value provider can be null, in which case no data will ever be updated -- you'd have to update it on your own as you saw fit. -
scheduleSeries
public static Stoppable scheduleSeries(GUIState state, PieChartSeriesAttributes attributes, ChartUtilities.ProvidesObjects valueProvider) Schedules a series with the MASON simulation. You specify a value provider to give series data each timestep. This value provider can be null, in which case no data will ever be updated -- you'd have to update it on your own as you saw fit. -
scheduleSeries
public static Stoppable scheduleSeries(GUIState state, PieChartSeriesAttributes attributes, ChartUtilities.ProvidesCollection valueProvider) Schedules a series with the MASON simulation. You specify a value provider to give series data each timestep. This value provider can be null, in which case no data will ever be updated -- you'd have to update it on your own as you saw fit. -
buildBarChartGenerator
Builds a BarChartGenerator not attached to any MASON simulation. -
buildBarChartGenerator
Builds a BarChartGenerator and attaches it as a display in a MASON simulation. -
addSeries
Adds a series to the BarChartGenerator. -
scheduleSeries
public static Stoppable scheduleSeries(GUIState state, BarChartSeriesAttributes attributes, ChartUtilities.ProvidesDoublesAndLabels valueProvider) Schedules a series with the MASON simulation. You specify a value provider to give series data each timestep. This value provider can be null, in which case no data will ever be updated -- you'd have to update it on your own as you saw fit. -
scheduleSeries
public static Stoppable scheduleSeries(GUIState state, BarChartSeriesAttributes attributes, ChartUtilities.ProvidesObjects valueProvider) Schedules a series with the MASON simulation. You specify a value provider to give series data each timestep. This value provider can be null, in which case no data will ever be updated -- you'd have to update it on your own as you saw fit. -
scheduleSeries
public static Stoppable scheduleSeries(GUIState state, BarChartSeriesAttributes attributes, ChartUtilities.ProvidesCollection valueProvider) Schedules a series with the MASON simulation. You specify a value provider to give series data each timestep. This value provider can be null, in which case no data will ever be updated -- you'd have to update it on your own as you saw fit.
-