2の方法が考えられます。
(1) If the chart is displayed as an applet, like API example #42, then the line can be drawn dynamically with mouse by adding java mouse-handler codes to the source of this example.
Please note that this approach works only with the applet display.
Once the line is added to the applet, the applet may be printed or saved into JPEG format on the server side, and the JPEG can then be downloaded to the client.