Example usage for org.jfree.chart ChartUtils saveChartAsJPEG

List of usage examples for org.jfree.chart ChartUtils saveChartAsJPEG

Introduction

In this page you can find the example usage for org.jfree.chart ChartUtils saveChartAsJPEG.

Prototype

public static void saveChartAsJPEG(File file, JFreeChart chart, int width, int height) throws IOException 

Source Link

Document

Saves a chart to a file in JPEG format.

Usage

From source file:net.sf.mzmine.chartbasics.graphicsexport.ChartExportUtil.java

public static void writeChartToJPEG(JFreeChart chart, int width, int height, File fileName) throws IOException {
    ChartUtils.saveChartAsJPEG(fileName, chart, width, height);
}

From source file:net.atomique.ksar.graph.Graph.java

public int saveJPG(final String filename, final int width, final int height) {
    try {// ww w . j  av  a 2s. c  om
        ChartUtils.saveChartAsJPEG(new File(filename),
                this.getgraph(mysar.myparser.getStartOfGraph(), mysar.myparser.getEndOfGraph()), width, height);
    } catch (IOException e) {
        log.error("Unable to write to : {}", filename);
        return -1;
    }
    return 0;
}