This class provides tools to create charts from data in a simple way. More...
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. | |
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.
| void umontreal.ssj.charts.CategoryChart.disableGrid | ( | ) |
Disables the background grid.
Definition at line 161 of file CategoryChart.java.
| 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.
| xstep | sets the step in the x-direction. |
| ystep | sets the step in the y-direction. |
Definition at line 153 of file CategoryChart.java.
| JFreeChart umontreal.ssj.charts.CategoryChart.getJFreeChart | ( | ) |
Returns the JFreeChart object associated with this chart.
Definition at line 72 of file CategoryChart.java.
| String umontreal.ssj.charts.CategoryChart.getTitle | ( | ) |
Gets the current chart title.
Definition at line 100 of file CategoryChart.java.
| Axis umontreal.ssj.charts.CategoryChart.getYAxis | ( | ) |
Returns the chart’s range axis ( \(y\)-axis) object.
Definition at line 81 of file CategoryChart.java.
| void umontreal.ssj.charts.CategoryChart.setAutoRange | ( | ) |
Sets chart \(y\) range to automatic values.
Definition at line 117 of file CategoryChart.java.
| void umontreal.ssj.charts.CategoryChart.setLatexDocFlag | ( | boolean | flag | ) |
Same as in XYChart.
Definition at line 177 of file CategoryChart.java.
| 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.
| title | chart title |
Definition at line 110 of file CategoryChart.java.
|
abstract |
Transforms the chart into LaTeX form and returns it as a String.
Reimplemented in umontreal.ssj.charts.BoxChart.
|
abstract |
Displays the chart on the screen using Swing.
| width | frame width |
| height | frame height |
Reimplemented in umontreal.ssj.charts.BoxChart.