开发者

jfreechart general issue on the possibility of interactlively modify a displayed curve dragging mouse

I've never used JFreeChart before. It has been told me that it's a pretty good product for drawing charts in Java.

I have a doubt, and I would like to have some advices by someone that has already some JFreeChart experience:

is JFreeChart designed only for display static precomputed set of values?

Or is there any "pretty easy" way to handle mouse e开发者_如何学运维vent (possibly dragging) in order to dynamically change the displayed curves (and consequentely the associated data set)?

With "pretty easy" I mean been able to do the following without having to write too much lines of code:

  1. Click on a displayed chart (for example Line Chart ) and identify the closer point of the dataset displayed .
  2. Use some sort of drag event to change the dataset value according to the movement of the mouse
  3. Show the updated chart interactively


JFreeChart can certainly handle dynamic charts, as shown here; and you can interact in a variety of ways with an existing chart, as shown here.

Addendum: Here's a few more specifics:

  1. The default tooltip generator displays data when you hover over a point, but you can also supply a custom generator.

  2. ChartPanel implements both MouseListener and MouseMotionListener.

  3. The JWS demo is a trove of examples, many interactive. The crosshair demos are particularly appealing.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜