ToolTip in servlet

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Suprigya

ToolTip in servlet

Post by Suprigya » Thu Oct 24, 2002 11:26 pm

Hi,
Is it possible to generate tooltip for the servlet?I understand we can get tooltip in jsp using
<%
String filename = LineChartServlet.doImage( request, response );
String graphURL = "http://localhost:8080/DisplayChart?filename=" + filename;
%>
<html>
<head>
<title>Line Chart </title>
</head>
<body>

<table border=0>
<tr>
<td>
<img src="<%= graphURL %>" width=500 height=300 border=0 usemap="#<%= filename %>">
</table>
</body>
</html>

I have just a servlet
http://localhost:8080/myServlet
which displays the image. How can I get tooltip on that? I saw new function on ChartFactory::
createLineChart(java.lang.String title,
java.lang.String categoryAxisLabel,
java.lang.String valueAxisLabel,
CategoryDataset data,
boolean legend,
boolean tooltips,
boolean urls)

Does this create tooltips? 0.9.4 is not working for me, so couldn't verify.
I have jCommon-0.7.1.jar also. Still 0.9.4 doesn't work?

Thanks.

Dave Gilbert

Re: ToolTip in servlet

Post by Dave Gilbert » Fri Oct 25, 2002 9:50 am

That tool tip flag just controls whether or not the chart will generate tool tip information when it is drawn - and that information will only be captured *if* a ChartRenderingInfo object is passed in to the drawing method.

It doesn't do anything to DISPLAY the tooltips, since the chart doesn't really know anything about where it is being drawn - it just gets passed a Graphics2D object.

The ChartPanel class knows how to display tool tips...but when it comes to servlets, I don't know how it is done. Richard Atkinson has done some work on the generation of HTML image maps, and I think it supports tool tips but I don't know the details...

Regards,

DG

Richard Atkinson

Re: ToolTip in servlet

Post by Richard Atkinson » Sun Oct 27, 2002 11:42 am

To get a JPEG or PNG chart to display tooltips you must have an associated
image map in the HTML page that contains the IMG tag. You cannot display
tooltips if the client browser is directly accessing (in the Address bar)
the servlet that binary streams the charts.

To get tooltips working with your charts you will have to change your
methodology.

Regards,
Richard...

Locked