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
Nested ClassesModifier and TypeClassDescriptionstatic interfaceThis class provides Collections of Objects to chart, or provides null if the current charted values shouldn't be changed.static interfaceThis 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 interfaceThis 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 interfaceThis class provides arrays of doubles to chart, or provides null if the current charted values shouldn't be changed.static interfaceThis class provides arrays of doubles to chart, with associated labels, or provides null if the current charted values shouldn't be changed.static interfaceThis class provides arrays of Objects to chart, or provides null if the current charted values shouldn't be changed.static interfaceThis 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
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic BarChartSeriesAttributesaddSeries(BarChartGenerator chart, String seriesName) Adds a series to the BarChartGenerator.static BoxPlotSeriesAttributesaddSeries(BoxPlotGenerator chart, String seriesName) Adds a series to the BoxPlotGenerator.static BubbleChartSeriesAttributesaddSeries(BubbleChartGenerator chart, String seriesName) Adds a series to the BubbleChartGenerator.static HistogramSeriesAttributesaddSeries(HistogramGenerator chart, String seriesName, int bins) Adds a series to the HistogramGenerator.static PieChartSeriesAttributesaddSeries(PieChartGenerator chart, String seriesName) Adds a series to the PieChartGenerator.static ScatterPlotSeriesAttributesaddSeries(ScatterPlotGenerator chart, String seriesName) Adds a series to the ScatterPlotGenerator.static TimeSeriesAttributesaddSeries(TimeSeriesChartGenerator chart, String seriesName) Adds a series to the TimeSeriesChartGeneratorstatic BarChartGeneratorbuildBarChartGenerator(String title) Builds a BarChartGenerator not attached to any MASON simulation.static BarChartGeneratorbuildBarChartGenerator(GUIState state, String title) Builds a BarChartGenerator and attaches it as a display in a MASON simulation.static BoxPlotGeneratorbuildBoxPlotGenerator(String title, String rangeAxisLabel) Builds a BoxPlotGenerator not attached to any MASON simulation.static BoxPlotGeneratorbuildBoxPlotGenerator(GUIState state, String title, String rangeAxisLabel) Builds a BoxPlotGenerator and attaches it as a display in a MASON simulation.static BubbleChartGeneratorbuildBubbleChartGenerator(String title, String rangeAxisLabel, String domainAxisLabel) Builds a BubbleChartGenerator not attached to any MASON simulation.static BubbleChartGeneratorbuildBubbleChartGenerator(GUIState state, String title, String rangeAxisLabel, String domainAxisLabel) Builds a BubbleChartGenerator and attaches it as a display in a MASON simulation.static HistogramGeneratorbuildHistogramGenerator(String title, String rangeAxisLabel) Builds a HistogramGenerator not attached to any MASON simulation.static HistogramGeneratorbuildHistogramGenerator(GUIState state, String title, String rangeAxisLabel) Builds a HistogramGenerator and attaches it as a display in a MASON simulation.static PieChartGeneratorbuildPieChartGenerator(String title) Builds a PieChartGenerator not attached to any MASON simulation.static PieChartGeneratorbuildPieChartGenerator(GUIState state, String title) Builds a PieChartGenerator and attaches it as a display in a MASON simulation.static ScatterPlotGeneratorbuildScatterPlotGenerator(String title, String rangeAxisLabel, String domainAxisLabel) Builds a ScatterPlotGenerator not attached to any MASON simulation.static ScatterPlotGeneratorbuildScatterPlotGenerator(GUIState state, String title, String rangeAxisLabel, String domainAxisLabel) Builds a ScatterPlotGenerator and attaches it as a display in a MASON simulation.static TimeSeriesChartGeneratorbuildTimeSeriesChartGenerator(String title, String domainAxisLabel) Builds a TimeSeriesChartGenerator not attached to any MASON simulation.static TimeSeriesChartGeneratorbuildTimeSeriesChartGenerator(GUIState state, String title, String domainAxisLabel) Builds a TimeSeriesChartGenerator and attaches it as a display in a MASON simulation.static StoppablescheduleSeries(GUIState state, BarChartSeriesAttributes attributes, ChartUtilities.ProvidesCollection valueProvider) Schedules a series with the MASON simulation.static StoppablescheduleSeries(GUIState state, BarChartSeriesAttributes attributes, ChartUtilities.ProvidesDoublesAndLabels valueProvider) Schedules a series with the MASON simulation.static StoppablescheduleSeries(GUIState state, BarChartSeriesAttributes attributes, ChartUtilities.ProvidesObjects valueProvider) Schedules a series with the MASON simulation.static StoppablescheduleSeries(GUIState state, BoxPlotSeriesAttributes attributes, ChartUtilities.ProvidesDoubleDoublesAndLabels valueProvider) Schedules a series with the MASON simulation.static StoppablescheduleSeries(GUIState state, BoxPlotSeriesAttributes attributes, ChartUtilities.ProvidesDoubles valueProvider) Schedules a series with the MASON simulation.static StoppablescheduleSeries(GUIState state, BubbleChartSeriesAttributes attributes, ChartUtilities.ProvidesTripleDoubles valueProvider) Schedules a series with the MASON simulation.static StoppablescheduleSeries(GUIState state, HistogramSeriesAttributes attributes, ChartUtilities.ProvidesDoubles valueProvider) Schedules a series with the MASON simulation.static StoppablescheduleSeries(GUIState state, PieChartSeriesAttributes attributes, ChartUtilities.ProvidesCollection valueProvider) Schedules a series with the MASON simulation.static StoppablescheduleSeries(GUIState state, PieChartSeriesAttributes attributes, ChartUtilities.ProvidesDoublesAndLabels valueProvider) Schedules a series with the MASON simulation.static StoppablescheduleSeries(GUIState state, PieChartSeriesAttributes attributes, ChartUtilities.ProvidesObjects valueProvider) Schedules a series with the MASON simulation.static StoppablescheduleSeries(GUIState state, ScatterPlotSeriesAttributes attributes, ChartUtilities.ProvidesDoubleDoubles valueProvider) Schedules a series with the MASON simulation.static StoppablescheduleSeries(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.
-