LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Programmatically Implementing a Graph "Peak" Function

Hello,

I'm trying to implement a "find peak" function for a spectral graph where a cursor would automatically move to the x-axis location that has the highest y-value. I've attached my simple code routine that does this. It kinda works -- when I'm fully zoomed out on the x-axis (i.e. autoscale), and I engage this function, the cursor seems to miss the peak by a couple of samples. However, if I'm zoomed in on the graph around the peak, and I engage the function, it seems to snap to the correct value.

Just wondering how the axis scaling relates to the cursor x-y position?

Regards
-Ted

0 Kudos
Message 1 of 2
(2,408 Views)
OK -- I discovered there is a cursor index property. Rather than scaling the x-y location, using this index property seems to make the routine work just fine.

-Ted
0 Kudos
Message 2 of 2
(2,402 Views)