Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

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

 
perumal mani
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • 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.
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • 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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic