Rendering.writeNewLine(writer);
BufferedImage image = chart.make();
final byte[] imageAsByteArray = Rendering.encodeAsPNG(image);
final JfcRenderHints renderHints = chart.getRenderHints();
final ChartRenderingInfo renderingInfo = renderHints.getRenderingInfo();
String mapId = renderHints.getMapId(chart);
String map = MapRenderUtilities.getImageMapExt(chart, mapId, renderingInfo,
new StandardToolTipTagFragmentGenerator(), new StandardURLTagFragmentGenerator());
renderHints.setMap(map);
if (view.getChartPopup() != null) {
encodeChartPopup(facesContext, chart, view, renderingInfo);
}
chart.setImageBytes(imageAsByteArray);