| java.lang.Object org.jfree.chart.ChartUtilities
ChartUtilities | abstract public class ChartUtilities (Code) | | A collection of utility methods for JFreeChart. Includes methods for
converting charts to image formats (PNG and JPEG) plus creating simple HTML
image maps.
See Also: ImageMapUtilities |
Method Summary | |
public static byte[] | encodeAsPNG(BufferedImage image) Encodes a
BufferedImage to PNG format.
Parameters: image - the image (null not permitted). | public static byte[] | encodeAsPNG(BufferedImage image, boolean encodeAlpha, int compression) Encodes a
BufferedImage to PNG format.
Parameters: image - the image (null not permitted). Parameters: encodeAlpha - encode alpha? Parameters: compression - the PNG compression level (0-9). | public static String | getImageMap(String name, ChartRenderingInfo info) Creates an HTML image map. | public static String | getImageMap(String name, ChartRenderingInfo info, ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) Creates an HTML image map. | public static void | saveChartAsJPEG(File file, JFreeChart chart, int width, int height) Saves a chart to a file in JPEG format. | public static void | saveChartAsJPEG(File file, float quality, JFreeChart chart, int width, int height) Saves a chart to a file in JPEG format. | public static void | saveChartAsJPEG(File file, JFreeChart chart, int width, int height, ChartRenderingInfo info) Saves a chart to a file in JPEG format. | public static void | saveChartAsJPEG(File file, float quality, JFreeChart chart, int width, int height, ChartRenderingInfo info) Saves a chart to a file in JPEG format. | public static void | saveChartAsPNG(File file, JFreeChart chart, int width, int height) Saves a chart to the specified file in PNG format. | public static void | saveChartAsPNG(File file, JFreeChart chart, int width, int height, ChartRenderingInfo info) Saves a chart to a file in PNG format. | public static void | saveChartAsPNG(File file, JFreeChart chart, int width, int height, ChartRenderingInfo info, boolean encodeAlpha, int compression) Saves a chart to a file in PNG format. | public static void | writeBufferedImageAsJPEG(OutputStream out, BufferedImage image) Writes a
BufferedImage to an output stream in JPEG format. | public static void | writeBufferedImageAsJPEG(OutputStream out, float quality, BufferedImage image) Writes a
BufferedImage to an output stream in JPEG format. | public static void | writeBufferedImageAsPNG(OutputStream out, BufferedImage image) Writes a
BufferedImage to an output stream in PNG format. | public static void | writeBufferedImageAsPNG(OutputStream out, BufferedImage image, boolean encodeAlpha, int compression) Writes a
BufferedImage to an output stream in PNG format. | public static void | writeChartAsJPEG(OutputStream out, JFreeChart chart, int width, int height) Writes a chart to an output stream in JPEG format. | public static void | writeChartAsJPEG(OutputStream out, float quality, JFreeChart chart, int width, int height) Writes a chart to an output stream in JPEG format. | public static void | writeChartAsJPEG(OutputStream out, JFreeChart chart, int width, int height, ChartRenderingInfo info) Writes a chart to an output stream in JPEG format. | public static void | writeChartAsJPEG(OutputStream out, float quality, JFreeChart chart, int width, int height, ChartRenderingInfo info) Writes a chart to an output stream in JPEG format. | public static void | writeChartAsPNG(OutputStream out, JFreeChart chart, int width, int height) Writes a chart to an output stream in PNG format. | public static void | writeChartAsPNG(OutputStream out, JFreeChart chart, int width, int height, boolean encodeAlpha, int compression) Writes a chart to an output stream in PNG format. | public static void | writeChartAsPNG(OutputStream out, JFreeChart chart, int width, int height, ChartRenderingInfo info) Writes a chart to an output stream in PNG format. | public static void | writeChartAsPNG(OutputStream out, JFreeChart chart, int width, int height, ChartRenderingInfo info, boolean encodeAlpha, int compression) Writes a chart to an output stream in PNG format. | public static void | writeImageMap(PrintWriter writer, String name, ChartRenderingInfo info, boolean useOverLibForToolTips) Writes an image map to an output stream. | public static void | writeImageMap(PrintWriter writer, String name, ChartRenderingInfo info, ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) Writes an image map to the specified writer. | public static void | writeScaledChartAsPNG(OutputStream out, JFreeChart chart, int width, int height, int widthScaleFactor, int heightScaleFactor) Writes a scaled version of a chart to an output stream in PNG format. |
encodeAsPNG | public static byte[] encodeAsPNG(BufferedImage image, boolean encodeAlpha, int compression) throws IOException(Code) | | Encodes a
BufferedImage to PNG format.
Parameters: image - the image (null not permitted). Parameters: encodeAlpha - encode alpha? Parameters: compression - the PNG compression level (0-9). The byte array in PNG format. throws: IOException - if there is an I/O problem. |
saveChartAsJPEG | public static void saveChartAsJPEG(File file, JFreeChart chart, int width, int height) throws IOException(Code) | | Saves a chart to a file in JPEG format.
Parameters: file - the file (null not permitted). Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. throws: IOException - if there are any I/O errors. |
saveChartAsJPEG | public static void saveChartAsJPEG(File file, float quality, JFreeChart chart, int width, int height) throws IOException(Code) | | Saves a chart to a file in JPEG format.
Parameters: file - the file (null not permitted). Parameters: quality - the JPEG quality setting. Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. throws: IOException - if there are any I/O errors. |
saveChartAsJPEG | public static void saveChartAsJPEG(File file, JFreeChart chart, int width, int height, ChartRenderingInfo info) throws IOException(Code) | | Saves a chart to a file in JPEG format. This method allows you to pass
in a
ChartRenderingInfo object, to collect information about the
chart dimensions/entities. You will need this info if you want to
create an HTML image map.
Parameters: file - the file name (null not permitted). Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. Parameters: info - the chart rendering info (null permitted). throws: IOException - if there are any I/O errors. |
saveChartAsJPEG | public static void saveChartAsJPEG(File file, float quality, JFreeChart chart, int width, int height, ChartRenderingInfo info) throws IOException(Code) | | Saves a chart to a file in JPEG format. This method allows you to pass
in a
ChartRenderingInfo object, to collect information about the
chart dimensions/entities. You will need this info if you want to
create an HTML image map.
Parameters: file - the file name (null not permitted). Parameters: quality - the quality setting. Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. Parameters: info - the chart rendering info (null permitted). throws: IOException - if there are any I/O errors. |
saveChartAsPNG | public static void saveChartAsPNG(File file, JFreeChart chart, int width, int height) throws IOException(Code) | | Saves a chart to the specified file in PNG format.
Parameters: file - the file name (null not permitted). Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. throws: IOException - if there are any I/O errors. |
saveChartAsPNG | public static void saveChartAsPNG(File file, JFreeChart chart, int width, int height, ChartRenderingInfo info) throws IOException(Code) | | Saves a chart to a file in PNG format. This method allows you to pass
in a
ChartRenderingInfo object, to collect information about the
chart dimensions/entities. You will need this info if you want to
create an HTML image map.
Parameters: file - the file (null not permitted). Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. Parameters: info - the chart rendering info (null permitted). throws: IOException - if there are any I/O errors. |
saveChartAsPNG | public static void saveChartAsPNG(File file, JFreeChart chart, int width, int height, ChartRenderingInfo info, boolean encodeAlpha, int compression) throws IOException(Code) | | Saves a chart to a file in PNG format. This method allows you to pass
in a
ChartRenderingInfo object, to collect information about the
chart dimensions/entities. You will need this info if you want to
create an HTML image map.
Parameters: file - the file (null not permitted). Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. Parameters: info - the chart rendering info (null permitted). Parameters: encodeAlpha - encode alpha? Parameters: compression - the PNG compression level (0-9). throws: IOException - if there are any I/O errors. |
writeBufferedImageAsJPEG | public static void writeBufferedImageAsJPEG(OutputStream out, BufferedImage image) throws IOException(Code) | | Writes a
BufferedImage to an output stream in JPEG format.
Parameters: out - the output stream (null not permitted). Parameters: image - the image (null not permitted). throws: IOException - if there are any I/O errors. |
writeBufferedImageAsJPEG | public static void writeBufferedImageAsJPEG(OutputStream out, float quality, BufferedImage image) throws IOException(Code) | | Writes a
BufferedImage to an output stream in JPEG format.
Parameters: out - the output stream (null not permitted). Parameters: quality - the image quality (0.0f to 1.0f). Parameters: image - the image (null not permitted). throws: IOException - if there are any I/O errors. |
writeBufferedImageAsPNG | public static void writeBufferedImageAsPNG(OutputStream out, BufferedImage image) throws IOException(Code) | | Writes a
BufferedImage to an output stream in PNG format.
Parameters: out - the output stream (null not permitted). Parameters: image - the image (null not permitted). throws: IOException - if there are any I/O errors. |
writeBufferedImageAsPNG | public static void writeBufferedImageAsPNG(OutputStream out, BufferedImage image, boolean encodeAlpha, int compression) throws IOException(Code) | | Writes a
BufferedImage to an output stream in PNG format.
Parameters: out - the output stream (null not permitted). Parameters: image - the image (null not permitted). Parameters: encodeAlpha - encode alpha? Parameters: compression - the compression level (0-9). throws: IOException - if there are any I/O errors. |
writeChartAsJPEG | public static void writeChartAsJPEG(OutputStream out, JFreeChart chart, int width, int height) throws IOException(Code) | | Writes a chart to an output stream in JPEG format. Please note that
JPEG is a poor format for chart images, use PNG if possible.
Parameters: out - the output stream (null not permitted). Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. throws: IOException - if there are any I/O errors. |
writeChartAsJPEG | public static void writeChartAsJPEG(OutputStream out, float quality, JFreeChart chart, int width, int height) throws IOException(Code) | | Writes a chart to an output stream in JPEG format. Please note that
JPEG is a poor format for chart images, use PNG if possible.
Parameters: out - the output stream (null not permitted). Parameters: quality - the quality setting. Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. throws: IOException - if there are any I/O errors. |
writeChartAsJPEG | public static void writeChartAsJPEG(OutputStream out, JFreeChart chart, int width, int height, ChartRenderingInfo info) throws IOException(Code) | | Writes a chart to an output stream in JPEG format. This method allows
you to pass in a
ChartRenderingInfo object, to collect
information about the chart dimensions/entities. You will need this
info if you want to create an HTML image map.
Parameters: out - the output stream (null not permitted). Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. Parameters: info - the chart rendering info (null permitted). throws: IOException - if there are any I/O errors. |
writeChartAsJPEG | public static void writeChartAsJPEG(OutputStream out, float quality, JFreeChart chart, int width, int height, ChartRenderingInfo info) throws IOException(Code) | | Writes a chart to an output stream in JPEG format. This method allows
you to pass in a
ChartRenderingInfo object, to collect
information about the chart dimensions/entities. You will need this
info if you want to create an HTML image map.
Parameters: out - the output stream (null not permitted). Parameters: quality - the output quality (0.0f to 1.0f). Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. Parameters: info - the chart rendering info (null permitted). throws: IOException - if there are any I/O errors. |
writeChartAsPNG | public static void writeChartAsPNG(OutputStream out, JFreeChart chart, int width, int height) throws IOException(Code) | | Writes a chart to an output stream in PNG format.
Parameters: out - the output stream (null not permitted). Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. throws: IOException - if there are any I/O errors. |
writeChartAsPNG | public static void writeChartAsPNG(OutputStream out, JFreeChart chart, int width, int height, boolean encodeAlpha, int compression) throws IOException(Code) | | Writes a chart to an output stream in PNG format.
Parameters: out - the output stream (null not permitted). Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. Parameters: encodeAlpha - encode alpha? Parameters: compression - the compression level (0-9). throws: IOException - if there are any I/O errors. |
writeChartAsPNG | public static void writeChartAsPNG(OutputStream out, JFreeChart chart, int width, int height, ChartRenderingInfo info) throws IOException(Code) | | Writes a chart to an output stream in PNG format. This method allows
you to pass in a
ChartRenderingInfo object, to collect
information about the chart dimensions/entities. You will need this
info if you want to create an HTML image map.
Parameters: out - the output stream (null not permitted). Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. Parameters: info - the chart rendering info (null permitted). throws: IOException - if there are any I/O errors. |
writeChartAsPNG | public static void writeChartAsPNG(OutputStream out, JFreeChart chart, int width, int height, ChartRenderingInfo info, boolean encodeAlpha, int compression) throws IOException(Code) | | Writes a chart to an output stream in PNG format. This method allows
you to pass in a
ChartRenderingInfo object, to collect
information about the chart dimensions/entities. You will need this
info if you want to create an HTML image map.
Parameters: out - the output stream (null not permitted). Parameters: chart - the chart (null not permitted). Parameters: width - the image width. Parameters: height - the image height. Parameters: info - carries back chart rendering info (null permitted). Parameters: encodeAlpha - encode alpha? Parameters: compression - the PNG compression level (0-9). throws: IOException - if there are any I/O errors. |
writeImageMap | public static void writeImageMap(PrintWriter writer, String name, ChartRenderingInfo info, boolean useOverLibForToolTips) throws IOException(Code) | | Writes an image map to an output stream.
Parameters: writer - the writer (null not permitted). Parameters: name - the map name (null not permitted). Parameters: info - the chart rendering info (null not permitted). Parameters: useOverLibForToolTips - whether to use OverLIB for tooltips(http://www.bosrup.com/web/overlib/). throws: IOException - if there are any I/O errors. |
writeImageMap | public static void writeImageMap(PrintWriter writer, String name, ChartRenderingInfo info, ToolTipTagFragmentGenerator toolTipTagFragmentGenerator, URLTagFragmentGenerator urlTagFragmentGenerator) throws IOException(Code) | | Writes an image map to the specified writer.
Parameters: writer - the writer (null not permitted). Parameters: name - the map name (null not permitted). Parameters: info - the chart rendering info (null not permitted). Parameters: toolTipTagFragmentGenerator - a generator for the HTML fragmentthat will contain the tooltip text (null not permitted if info contains tooltip information). Parameters: urlTagFragmentGenerator - a generator for the HTML fragment thatwill contain the URL reference (null not permitted if info contains URLs). throws: IOException - if there are any I/O errors. |
writeScaledChartAsPNG | public static void writeScaledChartAsPNG(OutputStream out, JFreeChart chart, int width, int height, int widthScaleFactor, int heightScaleFactor) throws IOException(Code) | | Writes a scaled version of a chart to an output stream in PNG format.
Parameters: out - the output stream (null not permitted). Parameters: chart - the chart (null not permitted). Parameters: width - the unscaled chart width. Parameters: height - the unscaled chart height. Parameters: widthScaleFactor - the horizontal scale factor. Parameters: heightScaleFactor - the vertical scale factor. throws: IOException - if there are any I/O problems. |
|
|