class GraphSupport {

    public static void writeChartToImageFile(JFreeChart chart, File chartFile) {<FILL_FUNCTION_BODY>}

    private GraphSupport() {
    }

}

        BufferedImage chartImage = chart.createBufferedImage(1024, 768);
        try (OutputStream out = new FileOutputStream(chartFile)) {
            ImageIO.write(chartImage, "png", out);
        } catch (IOException e) {
            throw new IllegalArgumentException("Failed writing chartFile (" + chartFile + ").", e);
        }
    
<no_super_class>