0

I have a XYPlot in JFree Chart with origin at (0,0).Now user clicks on anywhere in the chart.On clicking I want to draw a line from the origin to the coordinate point and extend the line till the end of the chart.

Please suggest!

I am new to Jfreechart and required this solution urgently.

Thanks in advance!

Sanjoy

  • One simple way is to use a ChartMouseListener. Refer to the answer [Here][1] [1]: http://stackoverflow.com/questions/8523128/jfree-chart-find-subplot – Makarand Dec 19 '11 at 10:43

1 Answers1

0

One approach is to override mousePressed() to get the coordinates and override drawSecondaryPass() to draw the line.

trashgod
  • 203,806
  • 29
  • 246
  • 1,045