umontreal.iro.lecuyer.charts
Class CategoryChart
- java.lang.Object
-
- umontreal.iro.lecuyer.charts.CategoryChart
-
- Direct Known Subclasses:
- BoxChart
public abstract class CategoryChart extends java.lang.ObjectThis 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 encapsulatedSSJCategorySeriesCollectionobject representing the data, and anAxisobject 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.
-
-
Constructor Summary
Constructors Constructor and Description CategoryChart()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method and Description voiddisableGrid()Disables the background grid.voidenableGrid(double xstep, double ystep)Puts a grid on the background.JFreeChartgetJFreeChart()Returns the JFreeChart object associated with this chart.java.lang.StringgetTitle()Gets the current chart title.AxisgetYAxis()Returns the chart's range axis (y-axis) object.voidsetAutoRange()Sets chart y range to automatic values.voidsetLatexDocFlag(boolean flag)Same as inXYChart.voidsetTitle(java.lang.String title)Sets a title to this chart.abstract java.lang.StringtoLatex(double width, double height)Transforms the chart into LATEX form and returns it as a String.abstract javax.swing.JFrameview(int width, int height)
-
-
-
Method Detail
-
getJFreeChart
public JFreeChart getJFreeChart()
Returns the JFreeChart object associated with this chart.- Returns:
- the associated JFreeChart object.
-
getYAxis
public Axis getYAxis()
Returns the chart's range axis (y-axis) object.- Returns:
- chart's range axis (y-axis) object.
-
view
public abstract javax.swing.JFrame view(int width, int height)
-
getTitle
public java.lang.String getTitle()
Gets the current chart title.- Returns:
- Chart title.
-
setTitle
public void setTitle(java.lang.String title)
Sets a title to this chart. This title will appear on the chart displayed by methodview.- Parameters:
title- chart title.
-
setAutoRange
public void setAutoRange()
Sets chart y range to automatic values.
-
enableGrid
public void 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:
xstep- sets the step in the x-direction.ystep- sets the step in the y-direction.
-
disableGrid
public void disableGrid()
Disables the background grid.
-
toLatex
public abstract java.lang.String toLatex(double width, double height)Transforms the chart into LATEX form and returns it as a String.
-
setLatexDocFlag
public void setLatexDocFlag(boolean flag)
Same as inXYChart.
-
-
DMelt 3.0 © DataMelt by jWork.ORG