1

How can I implement the double domain cross-hairs for my jfreechart? Here is the requirement I need to honor.

enter image description here

The image is photo edited to show my requirement.

Thanks in advance

Akh
  • 5,961
  • 14
  • 53
  • 82

1 Answers1

2

You can use a ValueMarker, as shown here. You'll need to set the dash attributes in your Stroke; DEFAULT_GRIDLINE_STROKE is an example.

Community
  • 1
  • 1
trashgod
  • 203,806
  • 29
  • 246
  • 1,045
  • But my requirement needs both the cross-hairs to be movable dynamically firing crosshairs co-ordinates to update my below table. – Akh Feb 17 '12 at 01:49
  • You can implement [`ChartMouseListener`](http://www.jfree.org/jfreechart/api/javadoc/org/jfree/chart/ChartMouseListener.html), as illustrated [here](http://stackoverflow.com/a/8525187/230513). – trashgod Feb 17 '12 at 02:01
  • Thanks for the info. Let me try it. – Akh Feb 17 '12 at 18:20