Jump to content

Selecting a portion of a plot displayed on a graph


Recommended Posts

I have an application where I'm displaying multiple plots on a waveform graph. I would like to be able to draw a visible box (using the mouse) around a subset of the data, and then return the plot points thus selected. I first thought cursors (having them snap to the current mouse position on a mouse down event) - but there's no way to "draw" a box on a graph using cursors as far as I can tell. Plan B might be to use the box zoom tool, allowing the user to select a portion of the graph, after zooming to get the max/min of the graph, then undo the zoom (all the while deferring panel updates so the user can't see what's going on), but this seems like a hassle and it doesn't appear that deferring panel updates holds for zooming (the graph is updated in spite of the setting). Can anyone think of a better way?

Link to comment

What about checking for mouse-down / mouse-up events and positioning a square decoration accordingly? When you're finished you could move it off-screen.

What about overlaying a transparent picture control on the graph--or do you need to use the graph for other things besides just looking at it? You can do a lot of things with a picture control.

Just some ideas to maybe hack something together.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.