JFreechart教程

ChartUtilities 类

ChartUtilities 类

ChartUtilities 类位于 JFreeChart 库的 org.jfree.chart 包下。 此类也称为"ChartUtils类"。 就像 ChartFactory 类一样,这个类有许多静态方法。 此类中提供的大多数方法处理图表到图像格式或基本 HTML 图像映射的转换。

构造函数:

构造函数 说明
ChartUtils( ) 这是 ChartUtilities 类的默认构造函数

方法总结:

方法 说明
encodeAsPNG(BufferedImage image) 此方法将 BufferedImage 编码为 PNG 格式。
getImageMap(String name, ChartRenderingInfo info) 此方法创建一个 HTML 图像映射。
saveChartAsJPEG(File file, float quality, JFreeChart chart, int width, int height) 此方法将图表保存为 JPEG 格式的文件。
saveChartAsPNG(File file, JFreeChart chart, int width, int height) 此方法以PNG格式将图表保存到指定文件中。
writeChartAsJPEG(OutputStream out, float quality, JFreeChart chart, int width, int height) 此方法将图表写入 JPEG 格式的输出流。
writeImageMap(PrintWriter writer, String name, ChartRenderingInfo info, boolean useOverLibForToolTips) 此方法将图像映射写入输出流。
writeScaledChartAsPNG(OutputStream out, JFreeChart chart, int width, int height, int widthScaleFactor, int heightScaleFactor) 此方法将图表的缩放版本写入 PNG 格式的输出流。

昵称: 邮箱:
Copyright © 2022 立地货 All Rights Reserved.
备案号:京ICP备14037608号-4