Cursor movement with snap to nearest data

I would like to have a SINGLE cursor snap to the closest data point to the mouse cursor on an XY graph when mouse:down.
The cursor action requires dragging. Any way to have the cursor snap to the closest data point (closeset in euclidian pixal units) to the mouse location without dragging?
I've tried to extract the mouse coordinates and then search through a list of XY graph coordinates converted to pixel coordinates. It seems like the mapping of graph coordinates to pixel coordinates is inconsistent with changes in text and other features outside the graph area.
Useful features
1. output XY coordinates of at least one corner of the graph (inside where the data is) area.
2. An index to the closest data point in the graph where the mouse is located.
3. An option for a cursor to snap to the closest data point where the mouse is located while mouse:down.
Any workarounds (example VIs) are greatly appreciated.
Solved!
Go to Solution.

Here is some code attached which is hopefully useful to others.
The incorrect graph coordinates I referred to earlier was in an NI example "Draw Graph with Events". Maybe NI can fix in the next release? (Not the best example of how to do things correctly....).
have fun.
Attachments:
GraphMouseInteraction.zip ‏33 KB
Graph to pixel Coord.vi ‏39 KB

Similar Messages

  • Jumping mouse cursor movement with secondary monitor

    Mouse cursor movement is interrrupted or jumps as soon as a secondary monitor is connected to my iMac. Either mouse movement direction is affected. Typically cursor movement stops for about a second while moving mouse further. Then suddenly cusor jumps either forward or backward.
    As soon as secondary monitor is dicsonnected, cursor movement is perfeclty in synch with actual mouse movement.
    I would very much appreciate any hints to solve this issue.
    Thanks
    Ole

    Thanks for your link - read it already yesterday.
    Found after some further search other threads with exactly the same issue - unfortunately not yet solved:
    [Ati 4870 Monitor/Mouse problem|http://discussions.apple.com/thread.jspa?threadID=2130243&start=0&tstar t=0].
    [NEW09 imac External Monitor causes mouse to freeze every 4 sec for half sec |http://discussions.apple.com/thread.jspa?messageID=10832381&#10832381]
    This issue seems to affect various of monitor models.
    My secondary monitor is a Fujuistu Siemens model H19-1, resolution 1280 x 1024 @ 60 Hz, 32-Bit Colors connected via

  • Exporting a movie with the settings "nearest neighbor"

    Hello everybody!
    I am trying to upscale a movie from an old video game. The resolution is 320x240 and should be upscaled to 1440x1080. The problem is that I don't want Adobe Premiere Pro 6 to upscale it using a chroma subsampling method (http://ingomar.wesp.name/2011/04/dosbox-gameplay-video-capture.html), instead I want to use something similar to the option "nearest neigbor" (the one you have in Adobe Photoshop when you resize images). Why I want this is because I want to keep the pixels from the video game sharp. Is this possible to do?

    And if you take a screen cap, import it into Photoshop and upscale by a factor 4 (with Nearest Neighbour) the result is amazing!
    Actually, I find that up-rezzing with the Nearest Neighbor algorithm to be about the lowest quality of any of the algorithms. It came first, and is basically a holdover from about PS version 2.5. Bicubic interpolation was added later, and then Bicubic Smoother and Bicubic Sharper.
    However, I am always working with continuous tone, high-rez digital photographs, and not screen-caps, so perhaps my material is not the ultimate to judge Nearest Neighbor?
    Still, for a 16x increase, about the only thing that I can suggest (and this is for Stills, and not Video) would be Genuine Fractals (once Human Softaware, but acquired by another company). Still, that is beyond the max limit that I would be comfortable with.
    Others have mentioned Red Giant's Magic Bullet Instant HD, and I would download the trial, then test. That might be "as good as it get."
    Good luck,
    Hunt

  • In large PDF files my cursor moves around the page at warp speed. It does not seem to make any difference if I slow it down with Sys Prefs. This is not only in preview but also other programs to open PDFs.

    In large PDF files the cursor moves at warp speed with a mind of it's own, I've tried slowing it down in Sys Pref with no luck. On small files cursor action is normal. This happens in Safari, Preview and other programs that use PDF files. Sorry to say this does not seem to be a new problem with 7.# I've had it with prvevious versions of operating system Right now I'm using a Apple wireless mouse and key board. Using the USB keyboard and mouse the same problem does not go away.

    Please read this whole message before doing anything.
    This procedure is a test, not a solution. Don’t be disappointed when you find that nothing has changed after you complete it.
    Step 1
    The purpose of this step is to determine whether the problem is localized to your user account.
    Enable guest logins* and log in as Guest. Don't use the Safari-only “Guest User” login created by “Find My Mac.”
    While logged in as Guest, you won’t have access to any of your personal files or settings. Applications will behave as if you were running them for the first time. Don’t be alarmed by this; it’s normal. If you need any passwords or other personal data in order to complete the test, memorize, print, or write them down before you begin.
    Test while logged in as Guest. Same problem?
    After testing, log out of the guest account and, in your own account, disable it if you wish. Any files you created in the guest account will be deleted automatically when you log out of it.
    *Note: If you’ve activated “Find My Mac” or FileVault, then you can’t enable the Guest account. The “Guest User” login created by “Find My Mac” is not the same. Create a new account in which to test, and delete it, including its home folder, after testing.
    Step 2
    The purpose of this step is to determine whether the problem is caused by third-party system modifications that load automatically at startup or login, by a peripheral device, by a font conflict, or by corruption of the file system or of certain system caches.
    Disconnect all wired peripherals except those needed for the test, and remove all aftermarket expansion cards, if applicable. Start up in safe mode and log in to the account with the problem. You must hold down the shift key twice: once when you boot, and again when you log in.
    Note: If FileVault is enabled, or if a firmware password is set, or if the boot volume is a software RAID, you can’t do this. Ask for further instructions.
    Safe mode is much slower to boot and run than normal, with limited graphics performance, and some things won’t work at all, including sound output and Wi-Fi on certain models. The next normal boot may also be somewhat slow.
    The login screen appears even if you usually log in automatically. You must know your login password in order to log in. If you’ve forgotten the password, you will need to reset it before you begin.
    Test while in safe mode. Same problem?
    After testing, reboot as usual (not in safe mode) and verify that you still have the problem. Post the results of Steps 1 and 2.

  • My new photoshop Elements 11 opens off centered and won't move with my cursor (on a MacBook )why?

    My new photoshop Elements 11 opens off centered and won't move with my cursor (on a MacBook )why?

    Try deleting/renaming 'psa.prf' and 'status.dat' file from '~/library/Application Support/Adobe/Elements Organizer/11.0/Organizer'.
    ~Andromeda

  • My macbook pro is running very slow with some strange mouse and window movements. The trackpad is very unresponsive and when responding the cursor moves on its own and/or very erratically. When on safari the window suddenly zooms in or highlights words.

    My macbook pro is running very slow with some strange mouse and window movements. The trackpad is very unresponsive and when responding the cursor moves on its own and/or very erratically. When on safari the window suddenly zooms in or highlights words and looks them up via dictionary. I currently have a wireless mouse connected and I am still having the same problems.
    I fee like I may have a virus or my laptop is perhaps being accessed remotely. All of the sharing options are unchecked.
    HELP PLEASE
    Very worried!!

    Try these in order testing your system after each to see if it's back to normal:
    1. a. Resetting your Mac's PRAM and NVRAM
        b. Intel-based Macs: Resetting the System Management Controller (SMC)
    2. Restart the computer in Safe Mode, then restart again, normally. If this doesn't help, then:
         Boot to the Recovery HD: Restart the computer and after the chime press and hold down the
         COMMAND and R keys until the Utilities menu screen appears. Alternatively, restart the computer and
         after the chime press and hold down the OPTION key until the boot manager screen appears.
         Select the Recovery HD and click on the downward pointing arrow button.
    3. Repair the Hard Drive and Permissions: Upon startup select Disk Utility from the Utilities menu. Repair the Hard Drive and Permissions as follows.
    When the recovery menu appears select Disk Utility. After DU loads select your hard drive entry (mfgr.'s ID and drive size) from the the left side list.  In the DU status area you will see an entry for the S.M.A.R.T. status of the hard drive.  If it does not say "Verified" then the hard drive is failing or failed. (SMART status is not reported on external Firewire or USB drives.) If the drive is "Verified" then select your OS X volume from the list on the left (sub-entry below the drive entry,) click on the First Aid tab, then click on the Repair Disk button. If DU reports any errors that have been fixed, then re-run Repair Disk until no errors are reported. If no errors are reported click on the Repair Permissions button. Wait until the operation completes, then quit DU and return to the main menu. Select Restart from the Apple menu.
         Reinstall the 10.9.2 update: OS X Mavericks 10.9.2 Update (Combo).
    4. Reinstall Lion/Mountain Lion, Mavericks: Reboot from the Recovery HD. Select Reinstall Lion/Mountain Lion, Mavericks from the Utilities menu, and click on the Continue button.
    Note: You will need an active Internet connection. I suggest using Ethernet if possible because it is three times faster than wireless.
    Reinstall the 10.9.2 update: OS X Mavericks 10.9.2 Update (Combo).

  • Error: Could not continue scan with nolock due to data movement, DBCC proccache will clear the probelm

    SQL Server: 2008 R2 SP2
    Before describing my problem, I have gone via the forum, there is no view or functions inside my stored procedure
    When running a particular stored procedure inside crystal report, the error " Could not continue scan with nolock due to data movement" comes once every few weeks. After I clear the query cache plan, it works again for few weeks and the problem
    comes again. During these few weeks, there is no restart or query plan clearing.
    If I run the stored procedure inside SSMS, where the SQL statement is copied and pasted from SQL profiler during crystal report run, there is no error.
    I discovered running in SSMS and crystal report generate 2 different query plans even I copied the SQL from SQL profiler, I have actually saved the query plans. Unfortunately, this forum does not accept attachments, or otherwise I will post my query plans
    here.
    There is one thing I notice about the query plan is during nested loop operation, there is a warning "no join predicate". I don't use any views or UDF in the statement, nor did I use pre-1992 ANSI join syntax. However, I did use table variables.
    My guess is whether this will cause " Could not continue scan with nolock due to data movement", after I clear the cache, I run crystal report again, and I look at the plan again, the "nested loop no join predicate" warning is gone.
    Running this stored procedure took 1 second maximum, even when this error is popping up, it pop up within 1 second.
    DBCC checkdb has been run
    The same stored procedure running by crystal report in a SQL 2008 (non r2) live environment has no problems, so I am thinking this is R2 specific problems.
    The "nested loop no join predicate" error SQL statment is below, no views, no udf, but table variables
    INSERT @ChequeAccount
    SELECT        PS.PaySummaryID, PS.EmployeeID, PS.CostCentreID,
                (PS.GrossPay    + PS.LumpSumA + PS.LumpSumB    + PS.LumpSumD+ PS.LumpSumE+ PS.ETP+ PS.PaymentsAfterTax    - PS.DeductionsAfterTax  
     - PS.Tax- PS.ETPTax    + PS.TaxRebate) * -1 AS Amount,
                CGLM.GLAccountID
    FROM Pay_Summary PS JOIN Input_Sheet ISH ON PS.InputSheetID = ISH.InputSheetID  AND  ISH.PayrollID = @binPayrollID   
    AND PS.PaySummaryID NOT IN (SELECT PaySummaryID FROM @ChequeAccount)
    JOIN Payroll P ON P.PayrollID = ISH.PayrollID AND P.EmployerID = @binEmployerID
    JOIN CustomGLFixMapping CGLM ON CGLM.EmployerID = P.EmployerID AND CustomGLFixMappingNameID = 1 AND CGLM.CostCentreID IS NULL

    The error Could not continue scan with nolock due to data movement can occur when you use the NOLOCK table hint, or use the command SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED. That is, so-called dirty reads. The error is not related to the
    query plan per se, but when scanning a table, the storage engine will use an IAM scan rather than following the clustered index. If there is simultaneous activity, the storage engine may detect this and abort the operation to avoid returning incorrect data.
    Or it may not detect it, and return uncommitted data or fail to return committed data.
    All of these effects are transitory and they will not show up when you are alone on the system, only when there is concurrent activity in one or more of the tables in the query.
    Using dirty reads is a risky business for the reasons explained above, and it takes careful analysis to understand whether you can live with the errors you can get from a particular query. The error about data movement can be handled: trap the error and
    resubmit the query. But what about spurious incorrect results?
    If you believe locking to be a problem, you should consider setting the database to READ_COMMITTED_SNAPSHOT
    and take out all use of READ UNCOMMITTED/NOLOCK. When the database is in READ_COMMITTED_SNAPSHOT, readers read from the snapshot and only see committed data without blocking writers. This has some other effects like requiring a bigger tempdb,
    and there is a risk for other types of concurrency errors, but they tend to be smaller risks.
    I discovered running in SSMS and crystal report generate 2 different query plans even I copied the SQL from SQL profiler,
    This is because SSMS by default runs with SET ARITHABORT ON. I discuss this in more detail in this article on my web site:
    http://www.sommarskog.se/query-plan-mysteries.html
    However, as I said, this problem is not related to the query plan as such, although some query plans are more susceptible to this error than others. (All plans are suscpeitble to produce incorrect results).
    Erland Sommarskog, SQL Server MVP, [email protected]

  • I have a 27" desktop mac running with OSX 10.6.8.  The bluetooth keyboard started not typing when some of the keys are pressed. Plugged in a wired keyboard, started doing the same thing.  Now the cursor moves but cannot select anything.  Suggestions?

    I have a 27" desktop mac running with OSX 10.6.8.  The bluetooth keyboard started not typing when some of the keys are pressed. Plugged in a wired keyboard, started doing the same thing.  When opening up a browser or application, the cursor moves but cannot select anything.  Suggestions?

    Maybe something in these Apple support articles will help.
    Keyboard Doesn’t Work
    Keyboard Keys Do Not Respond
    Keyboard/Mouse – Troubleshooting Wireless

  • I am running Elements 11 on Windows 8.  When I use the healing tool, the entire image moves with the cursor.  How do I fix???  Thanks!

    I am running Elements 11 on Windows 8.  When I use the healing tool, the entire image moves with the cursor.  How do I fix???  Thanks!

    With the Healing Brush Tool selected, in the Tool Options, click on Clone Overlay and check Clipped.

  • Cannot open files with a double click !! Trackpad solution does not work, just makes my cursor move slowly. Have not found a solution in forums. Help needed please!!

    I cannot open files by double clicking ... have looked at forums and no solution yet !!! Control click is the only way i can open files
    "If you go to System Preferences > Accessibility > Mouse and Trackpad -  You can set the speed of the double click to be much slower.   Hope this helps someone else with a similar problem. "  this solution did not work it just made my cursor move at a snails pace.
    Thanks for any help forthcoming !!!

    found this on another websites forum .... it worked
    I figured it out. Thanks everyone!
    I had to turn on my wireless mouse... And even though I wasn't using my wireless mouse and just the trackpad...I had to turn on my wireless mouse then adjust those settings...Had to turn down the speed. Then Once I shut the mouse off and started to use the trackpad again it works perfectly.
    I'm not sure why the mouse settings would change the trackpad settings but it did.

  • My Mac book pro powers on and once on cursor moves but can not open anything with it.

    My Mac book pro powers on and once on cursor moves but can not open anything with it.

    ladislavfromcygnet wrote:
    Thank you Shootist007. I cannot do even Update now. I probably should have spent the same amount of money on a new IMac!
    No not really. If this is a brand new Macbook Pro take it back for a refund. Apple has a 14 day No Questions Asked return policy for Full refund.
    Take it back, get the Full Refund (DO NOT LET THEM TRY TO FIX IT. YOU BOUGHT A NEW COMPUTER NOT ONE THAT HAS BEEN WORKED ON OR NEEDS TO BE FIXED) and then decide whether to buy another Macbook Pro or the iMac. Or you could return it, get the Full refund and buy some other brand computer.

  • Screen moves with cursor

    My daughter has a g4 and just the other day for no apparent reason, the desktop seems to be about 10-15% too big for the screen. when you move the cursor, the screen/display moves around as the cursor moves. As you aproach the edge of the screen with the cursor, the desktop picture actually moves in the opposite direction to give access all the way to the edge. it's kind of strange.... I have tried to adjust any settings that I could find. It is set at the highest resolution. Lower res just makes things bigger and fatter.....
    help!
    ibook g4   Mac OS X (10.4.5)  

    THANKS NIEL! That was the thing.
    Best,
    wtl3
    ibook g4   Mac OS X (10.4.5)  

  • My pages stopped scrolling with cursor keys after upgrading to 5.0, the cursor moves WITHIN html documents and "jumps" from frame to frame and character to character within the frame.

    Recently, I noticed that google search pages stopped scrolling. There is an "right arrow" at the beginning of each link. When I press the cursor "up/down" arrow on the keyboard, the cursor jumps from link to link. Also, while on any html webpage, the cursor moves one character at a time (left / right arrow) and one line at a time (up/down arrow) until the end of that frame is reached, it then jumps to the next frame.

    You may have switched on [http://kb.mozillazine.org/accessibility.browsewithcaret caret browsing].
    You can press press F7 (on Mac: fn + F7) to toggle caret browsing on/off.
    * Tools > Options > Advanced : General: Accessibility: [ ] "Always use the cursor keys to navigate within pages"
    * http://kb.mozillazine.org/Scrolling_with_arrow_keys_no_longer_works
    * http://kb.mozillazine.org/Accessibility_features_of_Firefox

  • How do you disable text cursor movement when scrolling horizontally with a tilt wheel or touchpad; or rather, how do you make these horizontal scrolling actions only scroll horizontally and nothing else?

    Frequently when I use a touchpad or tilt wheel mouse to scroll horizontally, the web page does not scroll at all. Instead, the text cursor moves left or right. If the text box is off-screen, the page will jump to it, losing the spot on the page I was reading. This happens way too often given the sensitivity of touchpads and tilt wheel mice.
    I'd like to just disable the cursor movement function of the horizontal scroll. I don't feel that it is useful and it actually hurts my web browsing experience. I do not want to disable horizontal scrolling though; I just want it to always scroll horizontally and do nothing else.

    You would make this a little easier if you posted a link to the page.
    Most of the jump seems to be some extra padding or margin between the tabs  when you rollover, but I am not able to find it.  Is there any other css that is governing this page? I did remove a couple of <p></p> set of tags you had  and it improved the jump, but it is still there.
    If the page is live, run it through the validator http://validator.w3.org/ , fix whatever errors it finds, if you still have the jump, post a link to the page and the issue might get found.
    Gary

  • Unwanted Cursor Move Problem

    Hello
    I have a problem about cursors in XY Graph. I have two cursors and I want to get data between two cursors. I have snapped the cursors to the plot however, cursors perform unwanted move when I make them visible. hope there will be someone to help me.
    "You live in a graphical world. Why not program in one?"
    Attachments:
    GrafikKod_v1.4.vi ‏38 KB

    You did not include any of your subVIs, but overall the code looks weird. Wy do you use a 1ms timeout to rattle through numerous property nodes of the same graph. That's a very nervous program. At least combine all thse property nodes into one and use a more reasonable timeout.
    Can you attach a runnable version that includes all subVIs? Thanks!
    We also cannot see the cursors because they are locked to a plot, but the plot has no data.
    LabVIEW Champion . Do more with less code and in less time .

Maybe you are looking for

  • CS5.5 trial 1080p AVCHD import probs

    With AE CS5.5 trial, I cannot get XDCAM footage to display - neither as a dynamic link from PPCS5.5 nor a straight import of Sony XDCAM 1080p material  (The BPAV folder).  Importing does work with AE CS5 Can anyone please tell me whether this is a li

  • Data should get inserted in all tables if i enter the form field only once

    Hi, I have a new question again. There are 5 tables in a database, that is t1, t2, t3, t4 & t5. the first 4 table has one common column, known as lc_no. I have build the form using the form builder. In that form, there is a 1 text field for lc_no. I

  • "This program is blocked by group policy"

    Hi all. I have searched Google a fair bit on this but shockingly I just can't find an actual answer.  The Group Policy forum is where I should have started rather than finally come to :) I am no genius with GP, I use it in the most basic ways in very

  • Shockwave/Flash player crashes with ever browser

    I can't find a solution in this forum although a lot of people seem to be asking this question. Flash crashes constantly and it doesn't matter if I use Chrome, Firefox or IE. It's quite unbearable. I don't have multiple Flash players and if an add-on

  • How to use os x yosemite calculator - need decimal points

    I updated to OS X Yosemite version 10.10.2 for my Mac.  I cannot figure out how to use the calculator!  All I want is to add dollars and cents.  How do I get a decimal point?  I've searched the web and don't see this addressed.