I am a beginner working for the first time with JFreeChart, I have to modify an application using a PDF export by adding Charts and tables....and charts into tables.
I have tried to find answer but solutions seem to be quite ancient and nothing worked. Can anyone help please ?
this is the code of the cell:
Code: Select all
PdfPCell cell = new PdfPCell(new Phrase());
p = new Paragraph();
p.add(new Chunk("I'd like to put my chart here", myFont));
p.setAlignment(Element.ALIGN_CENTER);
cell = new PdfPCell();
cell.addElement(p);
cell.setUseAscender(true);
cell.setUseDescender(true);
table.addCell(cell);
Code: Select all
document.newPage();
JFreeChart Chart = myChart(0, 10, 20 , 30);
BufferedImage ChartBufferedImage = myChart.createBufferedImage(200, 200);
Image ChartImage = Image.getInstance(writer,ChartBufferedImage, 1.0f);
mainTable.addCell(ChartImage);
document.add(mainTable);
I have tried to be as specific as i could.
thanks,