Class ChartUtils
- java.lang.Object
-
- adams.gui.visualization.jfreechart.dataset.ChartUtils
-
public class ChartUtils extends Object
Helper methods for charts.- Author:
- FracPete (fracpete at waikato dot ac dot nz)
-
-
Field Summary
Fields Modifier and Type Field Description static String
KEY_DIAGONAL
-
Constructor Summary
Constructors Constructor Description ChartUtils()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static void
addDiagonal(org.jfree.data.xy.DefaultXYDataset dataset, double min, double max)
Adds a diagonal to the dataset.static void
applyColor(org.jfree.chart.plot.XYPlot plot, Color plotColor, Color diagonalColor, ColorProvider colorProvider)
Applies the color to the series.static void
applyShape(org.jfree.chart.plot.XYPlot plot, Shape shape)
Sets the shape for all series except the diagonal.static int
getDiagonalIndex(org.jfree.data.general.SeriesDataset dataset)
Returns the index of the series represnting a diagonal.static boolean
hasDiagonal(org.jfree.data.general.SeriesDataset dataset)
Checks the dataset whether a diagonal series is present.static boolean
isDiagonal(org.jfree.data.general.SeriesDataset dataset, int index)
Checks whether the specified series represents a diagonal.
-
-
-
Field Detail
-
KEY_DIAGONAL
public static final String KEY_DIAGONAL
- See Also:
- Constant Field Values
-
-
Method Detail
-
addDiagonal
public static void addDiagonal(org.jfree.data.xy.DefaultXYDataset dataset, double min, double max)
Adds a diagonal to the dataset.- Parameters:
dataset
- the dataset to add the diagonal tomin
- the minimum Ymax
- the maximum Y
-
getDiagonalIndex
public static int getDiagonalIndex(org.jfree.data.general.SeriesDataset dataset)
Returns the index of the series represnting a diagonal.- Parameters:
dataset
- the dataset- Returns:
- the 0-based index, -1 if none present
-
hasDiagonal
public static boolean hasDiagonal(org.jfree.data.general.SeriesDataset dataset)
Checks the dataset whether a diagonal series is present.- Parameters:
dataset
- the dataset to check- Returns:
- true if present
-
isDiagonal
public static boolean isDiagonal(org.jfree.data.general.SeriesDataset dataset, int index)
Checks whether the specified series represents a diagonal.- Parameters:
dataset
- the dataset to checkindex
- the index of the series to check- Returns:
- true if diagonal
-
applyShape
public static void applyShape(org.jfree.chart.plot.XYPlot plot, Shape shape)
Sets the shape for all series except the diagonal.- Parameters:
plot
- the plot to updateshape
- the shape to set, ignored if null
-
applyColor
public static void applyColor(org.jfree.chart.plot.XYPlot plot, Color plotColor, Color diagonalColor, ColorProvider colorProvider)
Applies the color to the series.- Parameters:
plot
- the plot to updateplotColor
- the plot color to use if just one series (or series with diagonal), ignored if nulldiagonalColor
- the color for the diagonal (if present)colorProvider
- the color provider to get the colors from (is not reset before calling "next()")
-
-