How to generate tool-tips for Bar Chart ?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
sakaray_c
Posts: 31
Joined: Mon Dec 22, 2003 11:35 am

How to generate tool-tips for Bar Chart ?

Post by sakaray_c » Fri Feb 27, 2004 9:02 am

Hi,

I have generated a Bar Chart. But tool-tips are not visible.
How to generate tool-tips ?

I have used following code to generate chart.

chart = ChartFactory.createBarChart
("",
"Subjects",
yaxisLabel,
objCategoryData,
PlotOrientation.VERTICAL,
true,
true,
false);

Thanks and Regards,
sakaray_c

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 » Fri Feb 27, 2004 11:07 am

By setting the second-to-last argument in the createBarChart() method to 'true', the chart is set up with an item label generator assigned to the renderer. This is the class that creates the tooltip strings.

Next, you need to display the chart in a form that supports tooltips. The ChartPanel class will display the tooltips by default (you can disable tooltip display in the panel, but you will know if you have done this).

You can also get tooltips to display in a web browser if you generate an HTML image map for the chart. Richard Atkinson's servlet demo is a good example of this:

http://homepage.ntlworld.com/richard_c_ ... freechart/
David Gilbert
JFreeChart Project Leader

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

Locked