Well I have to say that I had worked till today with the chart-creator 1.2.0 to make my charts in my pages. I tried today with the <p:columnChart> and I have to say: "WOW". I set up the life in true and see the chart updating itself was great.
But now I have a big question. My boss wants to have the DialChart that is include un JFreeChart,
http://www.jfree.org/jfreechart/images/ ... Demo2a.png you can see it in this page.
In the Primefaces user guide, the <p:graphicImage> can be used to show images of charts created via the JFreeChart classes.
Code: Select all
<p:graphicImage value="#{backingBean.chartImage}" />
Code: Select all
public class BackingBean {
private StreamedContent chartImage;
public BackingBean() {
try {
JFreeChart jfreechart = ChartFactory.createPieChart("Turkish Cities", createDataset(), true, true, false);
File chartFile = new File("dynamichart");
ChartUtilities.saveChartAsPNG(chartFile, jfreechart, 37300);
chartImage = new DefaultStreamedContent(new FileInputSt(chartFile), "image/png");
} catch (Exception e) {
e.printStackTrace();
}
}
private PieDataset createDataset() {
DefaultPieDataset dataset = new DefaultPieDataset();
dataset.setValue("Istanbul", new Double(45.0));
dataset.setValue("Ankara", new Double(15.0));
dataset.setValue("Izmir", new Double(25.2));
dataset.setValue("Antalya", new Double(14.8));
return dataset;
}
//getters and setters
}
I'm using jfreechart 1.0.13.
Thanks...
Primefaces ROCKS!!!!!!!!!!!!!