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

This class provides tools to create charts from data in a simple way. More...

Inheritance diagram for umontreal.ssj.charts.CategoryChart:
umontreal.ssj.charts.BoxChart

Public Member Functions

JFreeChart getJFreeChart ()
 Returns the JFreeChart object associated with this chart.
Axis getYAxis ()
 Returns the chart’s range axis ( \(y\)-axis) object.
abstract JFrame view (int width, int height)
 Displays the chart on the screen using Swing.
String getTitle ()
 Gets the current chart title.
void setTitle (String title)
 Sets a title to this chart.
void setAutoRange ()
 Sets chart \(y\) range to automatic values.
void enableGrid (double xstep, double ystep)
 Puts a grid on the background.
void disableGrid ()
 Disables the background grid.

Latex-specific methods @{

abstract String toLatex (double width, double height)
 Transforms the chart into LaTeX form and returns it as a String.
void setLatexDocFlag (boolean flag)
 Same as in XYChart.

Detailed Description

This class provides tools to create charts from data in a simple way.

Its main feature is to produce TikZ/PGF (see WWW link http://sourceforge.net/projects/pgf/) compatible source code which can be included in LaTeX documents, but it can also produce charts in other formats. One can easily create a new chart, and customize its appearance using methods of this class, with the encapsulated umontreal.ssj.charts.SSJCategorySeriesCollection object representing the data, and an umontreal.ssj.charts.Axis object representing the axis. All these classes depend on the JFreeChart API (see WWW link http://www.jfree.org/jfreechart/) which provides tools to build charts with Java, to draw them, and export them to files. However, only basic features are used here.

Moreover, CategoryChart provides methods to plot data using a MATLAB friendly syntax. None of these methods provides new features; they just propose a different syntax to create charts. Therefore some features are unavailable when using these methods only.

Definition at line 52 of file CategoryChart.java.

Member Function Documentation

◆ disableGrid()

void umontreal.ssj.charts.CategoryChart.disableGrid ( )

Disables the background grid.

Definition at line 161 of file CategoryChart.java.

◆ enableGrid()

void umontreal.ssj.charts.CategoryChart.enableGrid ( double xstep,
double ystep )

Puts a grid on the background.

It is important to note that the grid is always shifted in such a way that it contains the axes. Thus, the grid does not always have an intersection at the corner points; this occurs only if the corner points are multiples of the steps: xstep and ystep sets the step in each direction.

Parameters
xstepsets the step in the x-direction.
ystepsets the step in the y-direction.

Definition at line 153 of file CategoryChart.java.

◆ getJFreeChart()

JFreeChart umontreal.ssj.charts.CategoryChart.getJFreeChart ( )

Returns the JFreeChart object associated with this chart.

Returns
the associated JFreeChart object.

Definition at line 72 of file CategoryChart.java.

◆ getTitle()

String umontreal.ssj.charts.CategoryChart.getTitle ( )

Gets the current chart title.

Returns
Chart title.

Definition at line 100 of file CategoryChart.java.

◆ getYAxis()

Axis umontreal.ssj.charts.CategoryChart.getYAxis ( )

Returns the chart’s range axis ( \(y\)-axis) object.

Returns
chart’s range axis ( \(y\)-axis) object.

Definition at line 81 of file CategoryChart.java.

◆ setAutoRange()

void umontreal.ssj.charts.CategoryChart.setAutoRange ( )

Sets chart \(y\) range to automatic values.

Definition at line 117 of file CategoryChart.java.

◆ setLatexDocFlag()

void umontreal.ssj.charts.CategoryChart.setLatexDocFlag ( boolean flag)

Same as in XYChart.

Definition at line 177 of file CategoryChart.java.

◆ setTitle()

void umontreal.ssj.charts.CategoryChart.setTitle ( String title)

Sets a title to this chart.

This title will appear on the chart displayed by method view.

Parameters
titlechart title

Definition at line 110 of file CategoryChart.java.

◆ toLatex()

abstract String umontreal.ssj.charts.CategoryChart.toLatex ( double width,
double height )
abstract

Transforms the chart into LaTeX form and returns it as a String.

Reimplemented in umontreal.ssj.charts.BoxChart.

◆ view()

abstract JFrame umontreal.ssj.charts.CategoryChart.view ( int width,
int height )
abstract

Displays the chart on the screen using Swing.

Parameters
widthframe width
heightframe height
Returns
frame containing the chart

Reimplemented in umontreal.ssj.charts.BoxChart.


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