/** * Create a PNG image file from a JFreeChart object * * @param chart * The chart object to create an image from * @param path * The path and name of the image file to create * @param width * The width of the image in pixels * @param height * The height of the image in pixels * @param writer * A writer for the iamge map to be written to * @throws IOException */ private static void saveChartAsPNG( final JFreeChart chart, final String path, final int width, final int height, final PrintWriter writer, final ChartRenderingInfo info ) throws IOException { File file = new File( path + ".png" ); //$NON-NLS-1$ ChartUtilities.saveChartAsPNG( file, chart, width, height, info ); // TODO support tool tip generators // TODO support URL fragment generators // TODO: make the image map name unique on the page if ( writer != null ) { ChartUtilities.writeImageMap( writer, "map-name", info, true ); //$NON-NLS-1$ } }
writer.println("<p>"); if (!indexFile) { ChartUtilities.writeImageMap(writer, "chart", info, true);