I create dynamic images with JFreeChart. It works great.
Now I want to add image map to the charts. I can generate the map string at backing bean but cannot pass it to view. Becuase it is generated at the second request which image is generated.
Code: Select all
public class HistogramBean {
private StreamedContent chart;
private String imageMap;
public HistogramBean() {
FreeChart jFreeChart = .......;
File chartFile = new File (.........);
ChartRenderingInfo info = new ChartRenderingInfo(........);
ChartUtilities.saveChartAsPNG(....................... , info);
chart = new DefaultStreamedContent(.......................);
imageMap = ImageMapUtilities.getImageMap(....................);
logger.debug(imageMap);
}
How can I get the generated string correctly?
Thanks,
Primefaces 3.0.M1
Mojarra 2.0.4