SSJ  3.3.1
Stochastic Simulation in Java
Public Member Functions | Protected Attributes | List of all members
HistogramSeriesCollection Class Reference

Stores data used in a HistogramChart. More...

Inheritance diagram for HistogramSeriesCollection:
[legend]
Collaboration diagram for HistogramSeriesCollection:
[legend]

Public Member Functions

 HistogramSeriesCollection ()
 Creates a new HistogramSeriesCollection instance with empty dataset.
 
 HistogramSeriesCollection (double[]... data)
 Creates a new HistogramSeriesCollection instance with given data series. More...
 
 HistogramSeriesCollection (double[] data, int numPoints)
 Creates a new HistogramSeriesCollection instance with the given data series data. More...
 
 HistogramSeriesCollection (DoubleArrayList... data)
 Creates a new HistogramSeriesCollection. More...
 
 HistogramSeriesCollection (TallyStore... tallies)
 Creates a new HistogramSeriesCollection instance with default parameters and given data. More...
 
 HistogramSeriesCollection (TallyHistogram... tallies)
 Creates a new HistogramSeriesCollection instance with default parameters and given data. More...
 
 HistogramSeriesCollection (CustomHistogramDataset data)
 Creates a new HistogramSeriesCollection instance. More...
 
Data control methods
int add (double[] data)
 Adds a data series into the series collection. More...
 
int add (double[] data, int numPoints)
 Adds a data series into the series collection. More...
 
int add (DoubleArrayList observationSet)
 Adds a data series into the series collection. More...
 
int add (TallyStore tally)
 Adds a data series into the series collection. More...
 
CustomHistogramDataset getSeriesCollection ()
 Returns the CustomHistogramDataset object associated with the current variable. More...
 
List getBins (int series)
 Returns the bins for a series. More...
 
void setBins (int series, int bins)
 Sets bins periodic bins from the observation minimum values to the observation maximum value for a series. More...
 
void setBins (int series, int bins, double minimum, double maximum)
 Sets bins periodic bins from minimum to maximum for a series. More...
 
void setBins (int series, HistogramBin[] binsTable)
 Links bins given by table binsTable to a series. More...
 
List getValuesList (int series)
 Returns the values for a series. More...
 
double [] getValues (int series)
 Returns the values for a series. More...
 
void setValues (int series, List valuesList)
 Sets a new values set to a series from a List variable. More...
 
void setValues (int series, double[] values)
 Sets a new values set to a series from a table. More...
 
Rendering methods
boolean getFilled (int series)
 Returns the filled flag associated with the series-th data series. More...
 
void setFilled (int series, boolean filled)
 Sets the filled flag. More...
 
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. More...
 
double getOutlineWidth (int series)
 Returns the outline width in pt. More...
 
void setOutlineWidth (int series, double outline)
 Sets the outline width in pt. More...
 
String toLatex (double XScale, double YScale, double XShift, double YShift, double xmin, double xmax, double ymin, double ymax)
 
- Public Member Functions inherited from SSJXYSeriesCollection
double getX (int series, int index)
 Returns the \(x\)-value at the specified index in the specified series. More...
 
double getY (int series, int index)
 Returns the \(y\)-value at the specified index in the specified series. More...
 
XYDataset getSeriesCollection ()
 Returns the XYDataset object associated with the current object. More...
 
double [] getDomainBounds ()
 Returns domain ( \(x\)-coordinates) min and max values. More...
 
double [] getRangeBounds ()
 Returns range ( \(y\)-coordinates) min and max values. More...
 
String toString ()
 Returns in a String all data contained in the current object. More...
 
XYItemRenderer getRenderer ()
 Returns the XYItemRenderer object associated with the current object. More...
 
void setRenderer (XYItemRenderer renderer)
 Sets the XYItemRenderer object associated with the current variable. More...
 
Color getColor (int series)
 Gets the current plotting color of the selected series. More...
 
void setColor (int series, Color color)
 Sets a new plotting color to the series \(series\). More...
 
abstract 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. More...
 

Protected Attributes

boolean [] filled
 
double [] lineWidth
 
int numBin = 20
 
- Protected Attributes inherited from SSJXYSeriesCollection
XYItemRenderer renderer
 
XYDataset seriesCollection
 

Additional Inherited Members

- Static Protected Member Functions inherited from SSJXYSeriesCollection
static String detectXColorClassic (Color color)
 Converts a java Color object into a friendly and readable LaTeX/xcolor string. More...
 
static Color getDefaultColor (int index)
 Gives the default color associated with a series. More...
 
static double max (double[] t)
 
static double min (double[] t)
 

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.

Constructor & Destructor Documentation

◆ HistogramSeriesCollection() [1/6]

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.

◆ HistogramSeriesCollection() [2/6]

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

◆ HistogramSeriesCollection() [3/6]

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.

◆ HistogramSeriesCollection() [4/6]

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.

◆ HistogramSeriesCollection() [5/6]

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.

◆ HistogramSeriesCollection() [6/6]

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.

Member Function Documentation

◆ add() [1/4]

int add ( double []  data)

Adds a data series into the series collection.

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

◆ add() [2/4]

int 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.

◆ add() [3/4]

int 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.

◆ add() [4/4]

int 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.

◆ getBins()

List 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.

◆ getFilled()

boolean getFilled ( int  series)

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

Parameters
seriesseries index.
Returns
fill flag.

◆ getOutlineWidth()

double getOutlineWidth ( int  series)

Returns the outline width in pt.

Parameters
seriesseries index.

◆ getSeriesCollection()

CustomHistogramDataset getSeriesCollection ( )

Returns the CustomHistogramDataset object associated with the current variable.

Returns
CustomHistogramDataset object associated with the current variable.

◆ getValues()

double [] 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.

◆ getValuesList()

List 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.

◆ setBins() [1/3]

void 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.

◆ setBins() [2/3]

void 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.

◆ setBins() [3/3]

void 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.

◆ setFilled()

void 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.

◆ setMargin()

void setMargin ( double  margin)

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

Parameters
marginmargin percentage amount.

◆ setOutlineWidth()

void setOutlineWidth ( int  series,
double  outline 
)

Sets the outline width in pt.

Parameters
seriesseries index.
outlineoutline width.

◆ setValues() [1/2]

void 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.

◆ setValues() [2/2]

void 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.

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