How to format ToolTip ?

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
nilesh
Posts: 20
Joined: Wed May 21, 2003 10:56 am
Contact:

How to format ToolTip ?

Post by nilesh » Sun Sep 14, 2003 7:08 am

I have formatted value for PieChart as "#.0%" and display .27 as 27.0%
This is fine but my ToolTip (On Web Browser) is still showing value .27
How can I format value in Tooltip ?


ToolTip display in the form Name = Value ? Is there any option just displaying either name or value only ?


Thank You,
Nilesh

Matthias
Posts: 42
Joined: Fri Apr 18, 2003 9:49 am
Location: Germany

Post by Matthias » Sun Sep 14, 2003 2:06 pm

I think, this should display tooltips with percentages:

NumberFormat nf = new DecimalFormat("#.0%");
PieToolTipGenerator ttg = new StandardPieToolTipGenerator(nf);
plot.setToolTipGenerator(ttg);

If it does work in the web browser (because of Java 1.1?) you may overwrite the generateToolTip method of the StandardPieToolTipGenerator or write your own PieToolTipGenerator.

Locked