I have a web application, I must export my charts into pdf, that's why i chosed jfreechart.
I create my chart like this:
Code: Select all
public void piePaint(OutputStream out, Object data) throws IOException{
JFreeChart chart = createPieChart(
getModel().getPieData());
if (data instanceof MediaData) {
BufferedImage img = chart.createBufferedImage(500, 350);
ImageIO.write(img,"jpg",out);
}
}
private JFreeChart createPieChart(final PieDataset dataset) {
JFreeChart chart = ChartFactory.createPieChart
("chartName", dataset, true, false, false);
chart.getPlot().setForegroundAlpha(0.9f);
return chart;
}
I am showing on-the-fly the chart on html page
Code: Select all
<a4j:mediaOutput element="img" cacheable="false" session="false" createContent="#{statisticsController.piePaint}" value="#{mediaData}" mimeType="image/jpeg"/>
Code: Select all
Integer Width = 110;
Integer Height = 50;
Color Background = Color.white;
Color DrawColor = new Color(0,0,0);
Font font = new Font("Serif", Font.TRUETYPE_FONT, 30);
/** so on with setters and getters... */

No, your monitor isnt broken, its really red...
So what do you think about this?
Greetings, N
ps. my version: 1.0.12