Quantcast
Channel: LabVIEW topics
Viewing all articles
Browse latest Browse all 69585

Get graph point nearest to mouse cursor with log scale

$
0
0

I want to show a cursor on the point nearest to the mouse cursor. This will be used to select datapoints on an XY graph. It seems simple, just use the Map Coords to XY method and get the distance of this XY position to each graph point and take the minimum. The x-axis is on log scale, so I take the log base 10 on the x-values.

 

Basjong53_1-1725890052383.png

 

The subvi:

Basjong53_4-1725890175639.png

 

It almost works, it's just a little off. In the below example, clearly the nearest point is not selected.

Basjong53_5-1725890205170.png

 

Is my calculation wrong? Am I missing something else?


Viewing all articles
Browse latest Browse all 69585

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>