Hi,
What I'm trying to do is drag a line (data points) from a line chart using the mouse, then redraw it where I release the mouse. Can someone please suggest a method of doing this or tell me of some other way of moving a line (data points) from a line chart using the mouse. I'm open for any ideas......
thanks,
HM
dragging data in a linechart
Re: dragging data in a linechart
This isn't supported in JFreeChart at present, so you will have to do some coding to get it to work. In the ChartPanel class, there is a getEntityForPoint(...) method that might be of some help, although only the data points are considered entities at present (you could add lines if you wanted to).
I have to say though, JFreeChart (for me anyway) is a data presentation tool rather than a data manipulation tool. So when it comes to adding new features, my focus will be on the presentation side of things...
Regards,
DG
I have to say though, JFreeChart (for me anyway) is a data presentation tool rather than a data manipulation tool. So when it comes to adding new features, my focus will be on the presentation side of things...
Regards,
DG
Re: dragging data in a linechart
Thanks for replying so quickly. Well, what if I decided not to drag the line, instead I will click the line on some data point, then click on some other location on the chart, and have the chart redraw itself accordlying.
thanks,
HM
thanks,
HM
Re: dragging data in a linechart
A 'click-move-click' sequence isn't really that different to a 'mouseDown-move-mouseUp' sequence.
Certainly it would be possible to extend the current chart mouse events mechanism to add a mouse drag notification. You could have it notify an arbitrary listener that a particular chart entity was dragged from point A to point B. In response, you could update the dataset and redraw the chart. It would involve some modification to the code, but I'm pretty sure it could be done.
Regards,
DG.
Certainly it would be possible to extend the current chart mouse events mechanism to add a mouse drag notification. You could have it notify an arbitrary listener that a particular chart entity was dragged from point A to point B. In response, you could update the dataset and redraw the chart. It would involve some modification to the code, but I'm pretty sure it could be done.
Regards,
DG.
Re: dragging data in a linechart
The problem exists when I try to recompile it from source. Oh, and this isn't a critical issue for me so please don't go out of your way to try and figure it out. Thanks again, I appreciate it..........
thanks,
Hostos
thanks,
Hostos