This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Other Open Source Projects and the fly likes Tool tip is not coming when we displayed a graph in JSP Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "Tool tip is not coming when we displayed a graph in JSP" Watch "Tool tip is not coming when we displayed a graph in JSP" New topic
Author

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

perumal mani
Greenhorn

Joined: May 27, 2008
Posts: 5
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

Joined: Jun 06, 2007
Posts: 2716
    
    6

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


SCJP, SCWCD.
|Asking Good Questions|
 
wood burning stoves
 
subject: Tool tip is not coming when we displayed a graph in JSP
 
Similar Threads
How to make sense of my binary data
Storing InputStream object to Application scope in servlet and retrieving
how to draw graphs using jsp
Need Help Reading/Writing an Image using Spring MVC
session mangement problem