User interaction

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
Cerebus
Posts: 1
Joined: Sun Mar 04, 2018 12:29 pm
antibot: No, of course not.

User interaction

Post by Cerebus » Sun Mar 04, 2018 12:51 pm

Hi,
I've not used JFreeChart for many years now. While I'm pretty sure looking at the only reasonably related post I could find that what I'm trying to do is possible, I'd like to an opinion from the experts before I waste too much time on it.

I want to allow the user to draw multiple lines between points on a graph with the mouse, such that they snap on the graph along the y-axis. The user can also add a point to the centre of existing lines, and drag that new point both vertically and horizontally. All points are constrained so that only one user-generated line exists at any point on the x-axis. That is; they can't overlap. A new point on an existing line is constrained by its start and end points. The user can zoom in by drawing a box, or zoom back out with a button. He can also delete a user-created line, in a way that 'makes sense'. So if a line is part of chain of points, the resulting lines correct themselves to make a new chain (or single line).

Now, I already have code to do this written in native java by overriding paint. What I need to do next is add axis, scroll using mousewheel, pan, background colouring and possibly, in the future, the addition of 3d plots of how the graph is changing over time. (The 'sin wave' I have can periodically be altered.)

It appears I have 3 options.
1) Continue as I am, and write the axis code etc. myself. (Probably using JFreeChart just to do the 3d plots, which will not be interactive.)
2) Leverage the parts of JFreeChart that I've not done yet like the axis and background stuff, and somehow synchronise them with my existing paint code.
3) Rewrite the whole thing based on JFreeChart from the start.

What do you think would be the best option?

Many thanks.

Bitmann
Posts: 1
Joined: Tue Mar 06, 2018 11:06 am
antibot: No, of course not.
Contact:

Re: User interaction

Post by Bitmann » Tue Mar 06, 2018 11:15 am

hey,
I will try to answer one of your questions.
Check this topic, I think this is what you need.
https://github.com/jfree/jfreechart-fse/pull/15
Give us feedback after.Thanks
Regards

Locked