LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

how to mark points on a graph

Hi All,

I want to write a program which plots data on a surface graph then
allows the user to click on the graph and "mark" points on the plot. The
program should change the color of the "marked" points on the graph.
Based on the sample code provided by "Ben" here
(http://forums.ni.com/ni/board/message?board.id=170&view=by_date_ascending&message.id=144155#M144155)...
I wrote the attached code which uses "event structure" and cursors to do
the job. I used cursor to read the X,Y,Z position of the clicked point on
the plot and store them in arrays. These arrays then were feed into a
new plot added to the graph using CWPlots3D.Add() method. However, my
code does not draw the second plot (which would show marked points in
green) nor it does not get the marked points coordination correctly. I
appreciate your help to correct the code.

Thank you,

0 Kudos
Message 1 of 2
(3,002 Views)

Hi Trin,

I have altered your VI a little bit to get the marked points in an array. You will realize that the mouse up event is requested in a parallel loop, that's because this event doesn't get triggered ifyou drag a cursor.

All you have to do now is to make a graph from the array and create new cursors. But leave Cursor 1 always as the last one and save the past values to new cursors. But maybe you don't need to set a cursor on each marked point.

 

Kind regards,

Kleisi

0 Kudos
Message 2 of 2
(2,914 Views)