jfreechart可以存图在array吗?

想请问在jfreechart可以用array来画图或存图吗?如可以该如何写程序呢?如果不能那应该如何画重复的饼图在pdf呢?我想画的饼图在pdf是这样的。可以给些代码参考吗?

图片你可以放在一个Image[]数组里面

如何生成image就是jfreechart的事情了

你把jfreechart生成的image对象放在Image数组里面,然后传递给itext包进行生成PDF文件.

下面的代码调试成功,需要iText.jar(主要功能包),iTextAsian.jar(主要是用来输出汉字的亚洲语言包)
里面2张图片,我缩放了20%放在左下方50,450 200,450两个坐标位置,如果你需要多加几个一样的写法
至于生成的PDF位置你可以自己调,代码里面有写坐标位置,你可以具体查看下
[code="java"]
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.net.MalformedURLException;

import com.lowagie.text.Document;
import com.lowagie.text.DocumentException;
import com.lowagie.text.Image;
import com.lowagie.text.Paragraph;
import com.lowagie.text.pdf.PdfContentByte;
import com.lowagie.text.pdf.PdfWriter;

public class MakePdf1 {
public static void main(String[] args) {
Document document = new Document();
try {
PdfWriter writer = PdfWriter.getInstance(document, new FileOutputStream(
"d:/HelloWorld.pdf"));
document.open();
PdfContentByte cb = writer.getDirectContent();
document.add(new Paragraph("Hello World!"));
Image img = Image.getInstance("d:/fruit1.jpg");
img.scalePercent(20);//按尺寸缩小比例
/*50是从左下角开始的横向坐标,450是从左下角开始的纵向坐标*/

img.setAbsolutePosition(50, 450);
cb.addImage(img);

        Image img1 = Image.getInstance("d:/fruit1.jpg");
        img1.setAbsolutePosition(200, 450);
        img1.scalePercent(20);
        cb.addImage(img1);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (DocumentException e) {
        e.printStackTrace();
    } catch (MalformedURLException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    document.close();
    System.out.println("over~");
}

}
[/code]