• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Tool tip is not coming when we displayed a graph in JSP

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,
i genereated a graph using JFreechart in servlet and sent it back to page using response object. but for the graph the tool tip (Showing the exact value when mouse over the graph) is not coming. its working when i run it as a swing program separetly. i called my servlet in img src tag as below,

<img src = "graph.do />

and servlet returs jfreechart image object using Output Stream as below,

JFreeChart jfreechart = createChart();
BufferedImage bi = jfreechart.createBufferedImage(500,400);
ByteArrayOutputStream bos = new ByteArrayOutputStream();
response.setContentType("image/png");
OutputStream stream = null;
stream = response.getOutputStream();
ImageIO.write(bi,"png",bos);
byte[] imageData = bos.toByteArray();
response.setContentLength(imageData.length);
stream.write(imageData);
response.setStatus(HttpServletResponse.SC_OK);

but when i sent it to page using the above method, the tool tip is not coming for the graph is page. i need to know, how to bring the tool tip for a graph in JSP page. Waiting for Reply.
 
Bartender
Posts: 2856
10
Firefox Browser Fedora Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
There is a considerable difference when you run something as a standalone application and as a web application.

So I think comparing the two wont do.
I am unaware of JFreeChart but can you consider using javascript for showing tool tip, because I dont think you will be able to do it from the server.


Hope this helps
reply
    Bookmark Topic Watch Topic
  • New Topic