Search in sources :

Example 36 with ChartRenderingInfo

use of org.jfree.chart.ChartRenderingInfo in project pentaho-platform by pentaho.

the class JFreeChartEngine method saveChart.

/**
 * Create an image file using dataset object. This method takes a dataset object, e.g. a DialWidgetDefinition,
 * creates a JFreeChart object from it, and then creates an image file.
 *
 * @param dataset
 *          The
 * @param title
 *          The title of the chart
 * @param units
 *          The units of the chart value
 * @param fileName
 *          The path and file of the image to create
 * @param width
 *          The width of the image to create
 * @param height
 *          The height of the image to create
 * @param outputType
 *          The type of the image to create
 * @param writer
 *          A writer to writer the image map into
 * @param logger
 *          The logger to log any messages to
 */
public static void saveChart(final Dataset dataset, final String title, final String units, final String fileName, final int width, final int height, final int outputType, final PrintWriter writer, final ILogger logger) {
    ChartRenderingInfo info = new ChartRenderingInfo();
    JFreeChartEngine.saveChart(dataset, title, units, fileName, width, height, outputType, writer, info, logger);
}
Also used : ChartRenderingInfo(org.jfree.chart.ChartRenderingInfo)

Aggregations

ChartRenderingInfo (org.jfree.chart.ChartRenderingInfo)36 Test (org.junit.Test)15 JFreeChart (org.jfree.chart.JFreeChart)14 CategoryAxis (org.jfree.chart.axis.CategoryAxis)11 NumberAxis (org.jfree.chart.axis.NumberAxis)11 CategoryPlot (org.jfree.chart.plot.CategoryPlot)11 DefaultBoxAndWhiskerCategoryDataset (org.jfree.data.statistics.DefaultBoxAndWhiskerCategoryDataset)10 StandardEntityCollection (org.jfree.chart.entity.StandardEntityCollection)8 BoxAndWhiskerItem (org.jfree.data.statistics.BoxAndWhiskerItem)8 BufferedImage (java.awt.image.BufferedImage)7 PrintWriter (java.io.PrintWriter)7 StringWriter (java.io.StringWriter)7 Element (org.dom4j.Element)7 IPentahoRequestContext (org.pentaho.platform.api.engine.IPentahoRequestContext)7 Rectangle2D (java.awt.geom.Rectangle2D)6 Document (org.dom4j.Document)6 Graphics2D (java.awt.Graphics2D)5 Rectangle (java.awt.Rectangle)4 UnsupportedEncodingException (java.io.UnsupportedEncodingException)4 ChartEntity (org.jfree.chart.entity.ChartEntity)4