How to show Item Label dynamically !!

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
JfreeFan
Posts: 13
Joined: Fri Mar 23, 2007 12:11 pm

How to show Item Label dynamically !!

Post by JfreeFan » Wed Jul 11, 2007 12:56 pm

Hey,
I want that on my chart item label display only when i bring mouse on chart.
i.e.when i move cursor on chart it should display y value.i am using
CategoryItemLabelGenerator generator = new StandardCategoryItemLabelGenerator(
"{2}", new DecimalFormat("0.0"));

line3d.setSeriesItemLabelGenerator(dataset.getRowIndex(titleMonitor),generator);
line3d.setItemLabelsVisible(true);
It works great but it draws label on all points.But i want only when i bring cursor on chart.
Any suggestion
Thanks in advance!!

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 » Wed Jul 11, 2007 5:17 pm

Why not use tool tips for that?
David Gilbert
JFreeChart Project Leader

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

JfreeFan
Posts: 13
Joined: Fri Mar 23, 2007 12:11 pm

Post by JfreeFan » Fri Jul 13, 2007 10:11 am

Hey Dave,
Thanks for reply,but i have to show chart as PNG file.When i try in ChartPanel,toolstip works great.But in browser its not rendering info.
Any suggestion what to do more??

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 Jul 13, 2007 3:27 pm

You can get tooltips in a web app by creating an HTML image map for your chart.
David Gilbert
JFreeChart Project Leader

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

Locked