procope.tools
Class ChartTools

java.lang.Object
  extended by procope.tools.ChartTools

public class ChartTools
extends Object

Contains static methods to handle JFreeChart chart objects.

Author:
Jan Krumsiek

Constructor Summary
ChartTools()
           
 
Method Summary
static org.jfree.chart.JFreeChart generateHistogram(String title, double[] data, boolean relative, int bins)
          Generates a histogram chart from a given dataset.
static void writeChartToPNG(org.jfree.chart.JFreeChart chart, File output, int width, int height)
          Writes a given JFreeChart to a PNG file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ChartTools

public ChartTools()
Method Detail

writeChartToPNG

public static void writeChartToPNG(org.jfree.chart.JFreeChart chart,
                                   File output,
                                   int width,
                                   int height)
                            throws IOException
Writes a given JFreeChart to a PNG file.

Parameters:
chart - the chart to be plotte
output - output file
width - width of the image
height - height of the image
Throws:
IOException - if the file could not be written
See Also:
generateHistogram(String, double[], boolean, int), ROCCurveHandler.generateChart(java.util.List, java.util.List)

generateHistogram

public static org.jfree.chart.JFreeChart generateHistogram(String title,
                                                           double[] data,
                                                           boolean relative,
                                                           int bins)
Generates a histogram chart from a given dataset.

Parameters:
data - dataset from which the histogram will be calculated
relative - show relative frequencies?
bins - number of bins
Returns:
the histogram chart