Example usage for org.jfree.chart ChartUtils saveChartAsPNG

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

Introduction

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

Prototype

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

Source Link

Document

Saves a chart to the specified file in PNG format.

Usage

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

public int savePNG(final String filename, final int width, final int height) {
    try {/* w w  w . j  a v  a 2  s.  co  m*/
        ChartUtils.saveChartAsPNG(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;
}