0
votes

I'm trying to move the curve of the graph by dragging the mouse,

is this possible?

Here's a visual example of what I'm attempting to do:

enter image description here

I'm using the Teechart library in java, to draw the series I use a Jpanel (Swing).

Is there a function that allows me to do this?

1

1 Answers

0
votes

I'm not familiar with Teechart. Maybe it will handle mouse input. If not, add a MouseMotionListener to the component that's displaying the graph, and implement the mouseDragged method. The MouseEvent parameter has methods to tell you where the event occurred. Use that to decide whether to update the graph, and by how much, and call the appropriate Teechart methods. You might also want to add a MouseListener and implement mousePressed and mouseReleased. The sequence of events should be Pressed, Dragged, possibly more drags, Released.