How to create mouseover values...

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
charlie8410
Posts: 5
Joined: Wed Sep 05, 2007 1:28 pm

How to create mouseover values...

Post by charlie8410 » Wed Sep 05, 2007 2:03 pm

I've created a Dual Axis chart and now am trying to figure out how to add the mouseover values. A good example would be DualAxisDemo1 from the JFreeChart Demo.

Our company bought the developers guide and the source code that came along with it. I've tried looking through the source code but it doesn't appear to be as straight forward as the demo examples.

Some help would be appreciated. Thanks!

AlanH99
Posts: 18
Joined: Wed Apr 05, 2006 3:31 pm
Location: Edinburgh UK

Post by AlanH99 » Wed Sep 05, 2007 2:11 pm

Assuming you have added the Chart to a ChartPanel then you can use addChartMouseListener() in ChartPanel to add a mouse listener.

In your event handler you can then get a reference to a ChartEntity from the ChartMouseEvent.

charlie8410
Posts: 5
Joined: Wed Sep 05, 2007 1:28 pm

Re: How to create mouseover values

Post by charlie8410 » Wed Sep 05, 2007 3:13 pm

My next problem is that I am embedding this code in a ColdFusion file and have to set the response.setContentType as a jpeg. Don't know how tricky this is going to be.

meehaw
Posts: 10
Joined: Wed Aug 08, 2007 9:16 am

Post by meehaw » Thu Sep 06, 2007 9:25 am

I've asked about something similar but I found a solution here:

http://www.jfree.org/phpBB2/viewtopic.php?t=22172


A few clues that were enough for me.


Regards,
Michał

Locked