tool tip is not displaying in piechart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
muthuram
Posts: 9
Joined: Thu Nov 13, 2008 11:30 am

tool tip is not displaying in piechart

Post by muthuram » Thu Nov 13, 2008 11:43 am

Hello friends,
I am creating a pie chart in jsp page. pie chart is displaying correctly except the tool tip. The tool tip is getting generated when i view the pie chart in a separate frame. but it is not working in jsp page and when i keep the mouse over the chart the status bar of the browser shows error page. please give me any suggestions to find a solution.

Thanks,
Muthu

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Nov 13, 2008 12:16 pm

In a web page, you won't see tooltips unless you generate an HTML image map for your chart. Does your JSP do that?
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

muthuram
Posts: 9
Joined: Thu Nov 13, 2008 11:30 am

here is the code

Post by muthuram » Thu Nov 13, 2008 12:28 pm

<%String filename = StockChart.createPieChart(session,new PrintWriter(out));%>
<%String graphURL ="DisplayChart?filename=" +filename; %>
<img src="<%=graphURL %>" border=0 usemap="#<%= filename %>" style="margin-left: 50px">

this is the code i m using to display the image in my jsp. Am i doing right?

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Thu Nov 13, 2008 1:27 pm

I don't know, because I don't know what the StockChart class is or does, and I know very little about JSP.

That said, it seems unlikely that 'filename' can refer to both your chart image, and the HTML image map fragment that you need in the output.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

muthuram
Posts: 9
Joined: Thu Nov 13, 2008 11:30 am

Post by muthuram » Fri Nov 14, 2008 4:27 am

I don't have much idea about this html mapping. a similar program which I am referencing for my project uses the file name for mapping. it is working well in that program but not in mine. I couldn't able to find where i m making the mistake. can u please help me.

muthuram
Posts: 9
Joined: Thu Nov 13, 2008 11:30 am

Post by muthuram » Fri Nov 14, 2008 12:48 pm

at last i find what the problem is i think..

i saw the following errors in my firefox error console

overlib is not defined and nd is not defined

but i dont understand from where this error comes form and what i have to do.. do any body have a solution for this please help..

muthuram
Posts: 9
Joined: Thu Nov 13, 2008 11:30 am

Post by muthuram » Fri Nov 14, 2008 1:42 pm

I got it... I got it..
The think i needed to install ovelib.js a javascript available as open source.
now my site is displaying perfectly well..
i hope this post will helpful for those who struggles with the same problem

Thanks one and all

Muthu

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Post by matinh » Fri Nov 14, 2008 1:45 pm

Overlib is a JavaScript library for display tooltips. It is used by Cewolf for displaying tooltips in HTML using image maps.

Are you using Cewolf?

Your JSP code looks wired. The "src" attribute of the <img> tag must point to a servlet which returns an image (a PNG or JPG file). The usemap must point to an image map file.

- martin

muthuram
Posts: 9
Joined: Thu Nov 13, 2008 11:30 am

Post by muthuram » Fri Nov 14, 2008 2:03 pm

Hi matin
I am not using cewolf even i dont know what it is...
but my browser is asking for overlib.js to install.
I am sending the file name of the chart to the DisplayChart servlet in org.jfree.chart.servlet.DisplayChart. and mapping the filename in usemap.

matinh
Posts: 483
Joined: Fri Aug 11, 2006 10:08 am
Location: Austria

Post by matinh » Mon Nov 17, 2008 9:26 am

Hi Muthu!

I didn't know JFreeChart comes with a builtin servlet to display charts. When I last looked into this it didn't have this feature...

I just had a quick look at the sources and found that JFreeChart uses (can use) OverLib to display tooltips, but I never used it (wrote my own servlet).

OverLib can be found here. You will need to install it in your webapplication to make it avaiable to your browser. Unfortunately I can't help you any further as I never used JFreeCharts servlet classes.

hth,
- martin

Locked