SSJ API Documentation
Stochastic Simulation in Java
Loading...
Searching...
No Matches
umontreal.ssj.charts.HistogramSeriesCollection Class Reference

Stores data used in a HistogramChart. More...

Inheritance diagram for umontreal.ssj.charts.HistogramSeriesCollection:
umontreal.ssj.charts.SSJXYSeriesCollection

Public Member Functions

 HistogramSeriesCollection ()
 Creates a new HistogramSeriesCollection instance with empty dataset.
 HistogramSeriesCollection (double[]... data)
 Creates a new HistogramSeriesCollection instance with given data series.
 HistogramSeriesCollection (double[] data, int numPoints)
 Creates a new HistogramSeriesCollection instance with the given data series data.
 HistogramSeriesCollection (DoubleArrayList... data)
 Creates a new HistogramSeriesCollection.
 HistogramSeriesCollection (TallyStore... tallies)
 Creates a new HistogramSeriesCollection instance with default parameters and given data.
 HistogramSeriesCollection (TallyHistogram... tallies)
 Creates a new HistogramSeriesCollection instance with default parameters and given data.
 HistogramSeriesCollection (CustomHistogramDataset data)
 Creates a new HistogramSeriesCollection instance.
Data control methods @{
int add (double[] data)
 Adds a data series into the series collection.
int add (double[] data, int numPoints)
 Adds a data series into the series collection.
int add (DoubleArrayList observationSet)
 Adds a data series into the series collection.
int add (TallyStore tally)
 Adds a data series into the series collection.
CustomHistogramDataset getSeriesCollection ()
 Returns the CustomHistogramDataset object associated with the current variable.
List getBins (int series)
 Returns the bins for a series.
void setBins (int series, int bins)
 Sets bins periodic bins from the observation minimum values to the observation maximum value for a series.
void setBins (int series, int bins, double minimum, double maximum)
 Sets bins periodic bins from minimum to maximum for a series.
void setBins (int series, HistogramBin[] binsTable)
 Links bins given by table binsTable to a series.
List getValuesList (int series)
 Returns the values for a series.
double[] getValues (int series)
 Returns the values for a series.
void setValues (int series, List valuesList)
 Sets a new values set to a series from a List variable.
void setValues (int series, double[] values)
 Sets a new values set to a series from a table.
Rendering methods @{
boolean getFilled (int series)
 Returns the filled flag associated with the series-th data series.
void setFilled (int series, boolean filled)
 Sets the filled flag.
double getMargin ()
 Returns the margin which is a percentage amount by which the bars are trimmed.
void setMargin (double margin)
 Sets the margin which is a percentage amount by which the bars are trimmed for all series.
double getOutlineWidth (int series)
 Returns the outline width in pt.
void setOutlineWidth (int series, double outline)
 Sets the outline width in pt.
String toLatex (double XScale, double YScale, double XShift, double YShift, double xmin, double xmax, double ymin, double ymax)
 Formats and returns a string containing a LaTeX-compatible source code which represents this data series collection.
Public Member Functions inherited from umontreal.ssj.charts.SSJXYSeriesCollection
double getX (int series, int index)
 Returns the \(x\)-value at the specified index in the specified series.
double getY (int series, int index)
 Returns the \(y\)-value at the specified index in the specified series.
double[] getDomainBounds ()
 Returns domain ( \(x\)-coordinates) min and max values.
double[] getRangeBounds ()
 Returns range ( \(y\)-coordinates) min and max values.
String toString ()
 Returns in a String all data contained in the current object.
XYItemRenderer getRenderer ()
 Returns the XYItemRenderer object associated with the current object.
void setRenderer (XYItemRenderer renderer)
 Sets the XYItemRenderer object associated with the current variable.
Color getColor (int series)
 Gets the current plotting color of the selected series.
void setColor (int series, Color color)
 Sets a new plotting color to the series \(series\).

Additional Inherited Members

static String detectXColorClassic (Color color)
 Converts a java Color object into a friendly and readable LaTeX/xcolor string.
static Color getDefaultColor (int index)
 Gives the default color associated with a series.

Detailed Description

Stores data used in a HistogramChart.

HistogramSeriesCollection provides complementary tools to draw histograms. One may add observation sets, define histogram bins, set plot color and plot style, enable/disable filled shapes, and set margin between shapes for each series. This class is linked with class CustomHistogramDataset to store data plots, and linked with JFreeChart XYBarRenderer to render the plot. CustomHistogramDataset has been developed at the Université de Montréal to extend the JFreeChart API, and is used to manage histogram datasets in a JFreeChart chart.

Definition at line 53 of file HistogramSeriesCollection.java.

Constructor & Destructor Documentation

◆ HistogramSeriesCollection() [1/7]

umontreal.ssj.charts.HistogramSeriesCollection.HistogramSeriesCollection ( )

Creates a new HistogramSeriesCollection instance with empty dataset.

Definition at line 96 of file HistogramSeriesCollection.java.

◆ HistogramSeriesCollection() [2/7]

umontreal.ssj.charts.HistogramSeriesCollection.HistogramSeriesCollection ( double...[] data)

Creates a new HistogramSeriesCollection instance with given data series.

Bins the elements of data in equally spaced containers (the number of bins can be changed using the method setBins ). Each input parameter represents a data series.

Parameters
dataseries of point sets.

Definition at line 109 of file HistogramSeriesCollection.java.

◆ HistogramSeriesCollection() [3/7]

umontreal.ssj.charts.HistogramSeriesCollection.HistogramSeriesCollection ( double[] data,
int numPoints )

Creates a new HistogramSeriesCollection instance with the given data series data.

Bins the elements of data in equally spaced containers (the number of bins can be changed using the method setBins ). Only the first numPoints of data will be taken into account.

Parameters
dataPoint set
numPointsNumber of points to plot

Definition at line 142 of file HistogramSeriesCollection.java.

◆ HistogramSeriesCollection() [4/7]

umontreal.ssj.charts.HistogramSeriesCollection.HistogramSeriesCollection ( DoubleArrayList... data)

Creates a new HistogramSeriesCollection.

Bins the elements of data in equally spaced containers (the number of bins can be changed using the method setBins ). The input parameter represents a set of data plots. Each DoubleArrayList variable corresponds to a histogram on the chart.

Parameters
dataseries of observation sets.

Definition at line 172 of file HistogramSeriesCollection.java.

◆ HistogramSeriesCollection() [5/7]

umontreal.ssj.charts.HistogramSeriesCollection.HistogramSeriesCollection ( TallyStore... tallies)

Creates a new HistogramSeriesCollection instance with default parameters and given data.

The input parameter represents a collection of data observation sets. Each TallyStore input parameter represents an observation set.

Parameters
talliesseries of point sets.

Definition at line 205 of file HistogramSeriesCollection.java.

◆ HistogramSeriesCollection() [6/7]

umontreal.ssj.charts.HistogramSeriesCollection.HistogramSeriesCollection ( TallyHistogram... tallies)

Creates a new HistogramSeriesCollection instance with default parameters and given data.

The input parameter represents a collection of data observation sets. Each TallyHistogram input parameter represents an observation set. The 2 extra bins at the beginning and at the end of the tallies are not counted nor represented in the chart.

Parameters
talliesseries of point sets.

Definition at line 243 of file HistogramSeriesCollection.java.

◆ HistogramSeriesCollection() [7/7]

umontreal.ssj.charts.HistogramSeriesCollection.HistogramSeriesCollection ( CustomHistogramDataset data)

Creates a new HistogramSeriesCollection instance.

The input parameter represents a set of plotting data. Each series of the given collection corresponds to a histogram.

Parameters
dataseries of point sets.

Definition at line 277 of file HistogramSeriesCollection.java.

Member Function Documentation

◆ add() [1/4]

int umontreal.ssj.charts.HistogramSeriesCollection.add ( double[] data)

Adds a data series into the series collection.

Parameters
datanew series.
Returns
Integer that represent the new point set.

Definition at line 306 of file HistogramSeriesCollection.java.

◆ add() [2/4]

int umontreal.ssj.charts.HistogramSeriesCollection.add ( double[] data,
int numPoints )

Adds a data series into the series collection.

Only the first numPoints of data will be added to the new series.

Parameters
datanew series.
numPointsNumber of points to add
Returns
Integer that represent the new point set.

Definition at line 318 of file HistogramSeriesCollection.java.

◆ add() [3/4]

int umontreal.ssj.charts.HistogramSeriesCollection.add ( DoubleArrayList observationSet)

Adds a data series into the series collection.

Parameters
observationSetnew series values.
Returns
Integer that represent the new point set’s position in the CustomHistogramDataset object.

Definition at line 349 of file HistogramSeriesCollection.java.

◆ add() [4/4]

int umontreal.ssj.charts.HistogramSeriesCollection.add ( TallyStore tally)

Adds a data series into the series collection.

Parameters
tallyumontreal.ssj.stat.TallyStore to add values.
Returns
Integer that represent the new point set’s position in the CustomHistogramDataset object.

Definition at line 360 of file HistogramSeriesCollection.java.

◆ getBins()

List umontreal.ssj.charts.HistogramSeriesCollection.getBins ( int series)

Returns the bins for a series.

Parameters
seriesthe series index (in the range 0 to getSeriesCount() - 1).
Returns
A list of bins.
Exceptions
IndexOutOfBoundsExceptionif `series` is outside the specified range.

Definition at line 384 of file HistogramSeriesCollection.java.

◆ getFilled()

boolean umontreal.ssj.charts.HistogramSeriesCollection.getFilled ( int series)

Returns the filled flag associated with the series-th data series.

Parameters
seriesseries index.
Returns
fill flag.

Definition at line 497 of file HistogramSeriesCollection.java.

◆ getMargin()

double umontreal.ssj.charts.HistogramSeriesCollection.getMargin ( )

Returns the margin which is a percentage amount by which the bars are trimmed.

Definition at line 517 of file HistogramSeriesCollection.java.

◆ getOutlineWidth()

double umontreal.ssj.charts.HistogramSeriesCollection.getOutlineWidth ( int series)

Returns the outline width in pt.

Parameters
seriesseries index.

Definition at line 536 of file HistogramSeriesCollection.java.

◆ getSeriesCollection()

CustomHistogramDataset umontreal.ssj.charts.HistogramSeriesCollection.getSeriesCollection ( )

Returns the CustomHistogramDataset object associated with the current variable.

Returns
CustomHistogramDataset object associated with the current variable.

Reimplemented from umontreal.ssj.charts.SSJXYSeriesCollection.

Definition at line 370 of file HistogramSeriesCollection.java.

◆ getValues()

double[] umontreal.ssj.charts.HistogramSeriesCollection.getValues ( int series)

Returns the values for a series.

Parameters
seriesthe series index (in the range 0 to getSeriesCount() - 1).
Returns
A list of values.
Exceptions
(I ndexOutOfBoundsException if series is outside the specified range.

Definition at line 457 of file HistogramSeriesCollection.java.

◆ getValuesList()

List umontreal.ssj.charts.HistogramSeriesCollection.getValuesList ( int series)

Returns the values for a series.

Parameters
seriesthe series index (in the range 0 to getSeriesCount() - 1).
Returns
A list of values.
Exceptions
(I ndexOutOfBoundsException if series is outside the specified range.

Definition at line 443 of file HistogramSeriesCollection.java.

◆ setBins() [1/3]

void umontreal.ssj.charts.HistogramSeriesCollection.setBins ( int series,
HistogramBin[] binsTable )

Links bins given by table binsTable to a series.

Values falling on the boundary of adjacent bins will be assigned to the higher indexed bin.

Parameters
seriesthe series index (in the range 0 to getSeriesCount() - 1).
binsTablenew bins table.
Exceptions
IndexOutOfBoundsExceptionif `series` is outside the specified range.

Definition at line 429 of file HistogramSeriesCollection.java.

◆ setBins() [2/3]

void umontreal.ssj.charts.HistogramSeriesCollection.setBins ( int series,
int bins )

Sets bins periodic bins from the observation minimum values to the observation maximum value for a series.

Parameters
seriesthe series index (in the range 0 to getSeriesCount() - 1).
binsthe number of periodic bins.
Exceptions
IndexOutOfBoundsExceptionif `series` is outside the specified range.

Definition at line 398 of file HistogramSeriesCollection.java.

◆ setBins() [3/3]

void umontreal.ssj.charts.HistogramSeriesCollection.setBins ( int series,
int bins,
double minimum,
double maximum )

Sets bins periodic bins from minimum to maximum for a series.

Values falling on the boundary of adjacent bins will be assigned to the higher indexed bin.

Parameters
seriesthe series index (in the range 0 to getSeriesCount() - 1).
binsthe number of periodic bins.
minimumminimum value.
maximummaximum value.
Exceptions
IndexOutOfBoundsExceptionif `series` is outside the specified range.

Definition at line 415 of file HistogramSeriesCollection.java.

◆ setFilled()

void umontreal.ssj.charts.HistogramSeriesCollection.setFilled ( int series,
boolean filled )

Sets the filled flag.

This option fills histogram rectangular. The fill color is the current series color, alpha’s color parameter will be used to draw transparency.

Parameters
seriesseries index.
filledfill flag.

Definition at line 509 of file HistogramSeriesCollection.java.

◆ setMargin()

void umontreal.ssj.charts.HistogramSeriesCollection.setMargin ( double margin)

Sets the margin which is a percentage amount by which the bars are trimmed for all series.

Parameters
marginmargin percentage amount.

Definition at line 527 of file HistogramSeriesCollection.java.

◆ setOutlineWidth()

void umontreal.ssj.charts.HistogramSeriesCollection.setOutlineWidth ( int series,
double outline )

Sets the outline width in pt.

Parameters
seriesseries index.
outlineoutline width.

Definition at line 546 of file HistogramSeriesCollection.java.

◆ setValues() [1/2]

void umontreal.ssj.charts.HistogramSeriesCollection.setValues ( int series,
double[] values )

Sets a new values set to a series from a table.

Parameters
seriesthe series index (in the range 0 to getSeriesCount() - 1).
valuesnew values table.

Definition at line 479 of file HistogramSeriesCollection.java.

◆ setValues() [2/2]

void umontreal.ssj.charts.HistogramSeriesCollection.setValues ( int series,
List valuesList )

Sets a new values set to a series from a List variable.

Parameters
seriesthe series index (in the range 0 to getSeriesCount() - 1).
valuesListnew values list.

Definition at line 468 of file HistogramSeriesCollection.java.

◆ toLatex()

String umontreal.ssj.charts.HistogramSeriesCollection.toLatex ( double XScale,
double YScale,
double XShift,
double YShift,
double xmin,
double xmax,
double ymin,
double ymax )

Formats and returns a string containing a LaTeX-compatible source code which represents this data series collection.

The original datasets are shifted and scaled with the XShift, YShift, XScale and YScale parameters. xmin, xmax, ymin and ymax represent the chart bounds.

Parameters
XScaleDomain original data scale.
YScaleRange original data scale.
XShiftDomain original data shift value.
YShiftRange original data shift value.
xminDomain min bound.
xmaxDomain nax bound.
yminRange min bound.
ymaxRange nax bound.
Returns
TikZ code.

Reimplemented from umontreal.ssj.charts.SSJXYSeriesCollection.

Definition at line 550 of file HistogramSeriesCollection.java.


The documentation for this class was generated from the following file: