7 Replies Latest reply on Apr 8, 2009 7:02 AM by Janardan N

    useMap with a4j:mediaOutput

    Janardan N Newbie

      I need to display tooltips on a chart, which is displayed as image using a4j:mediaOutput.

      I'm converting my chart object to a BufferedImage and am displaying in the JSF page using a4j:mediaOutput.

      Can somebody please tell me how to use useMap attribute here...!

      I tried in the following way, but no luck in displaying the tooltips.

      
      public void getChartImage (OutputStream out, Object data) throws Exception {
       BufferedImage pageImage = getBufferedImageFromChart(); // Converts a JFreeChartImage to BufferedImage
      
       // JFreeChart way of generating imagemap.
       ChartRenderingInfo info = new ChartRenderingInfo(new StandardEntityCollection());
       ChartUtilities.writeImageMap(new PrintWriter(out), "chart", info, true); // "chart is the name of the image map"
      
       ImageIO.write(pageImage, "jpeg", out);
      }
      
      <a4j:mediaOutput
       element="img" cacheable="false" session="true" usemap="#chart"
       createContent="#{benchmarkReportsController.getChartImage}"
       mimeType="image/jpeg" />