LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

grid snapping in xy graph

Solved!
Go to solution

hi

 i want to snap the grid in xy graph

i am plotting graph using mouse down event

now i want to snap grid on mouse down(means if i click any where the point will be entered on nearest grid)

 

regards

mazhar

0 Kudos
Message 1 of 10
(4,524 Views)
Solution
Accepted by topic author mazhar.ali
That doesn't sound too difficult. In your Mouse Down event you should first use the Map Coordinates to XY method to (a) verify the user clicked in the plot area (as opposed to a click on a scale), and (b) get the XY point. Then, you can use the <X/Y>Scale.Range.Increment and/or the <X/Y>Scale.Range.Minor Increment preoperties to coerce your number to the grid depending on whether you want to snap to the major grid or to the major and minor grid. This latter part is just math.
Message 2 of 10
(4,520 Views)

thanx man

 

give me example vi.

 

 

0 Kudos
Message 3 of 10
(4,515 Views)

Gee, and you ask so nicely, too.

 

Why don't you try it yourself first? Though I see you've asked this question before.

Message 4 of 10
(4,513 Views)

thanx smercurio

 

may be i have not describe my problem clearly.

 

let me explain first  the link of my post you reffered  the main problems of that post are two constant because when i change size of my graph i loose alignment of the cursor and entered position. after some time and debuging i fix that and make it generic(mean if some one change graph size the alignment will not take effect) see the property which replace that constant.

Message Edited by mazhar.ali on 02-18-2009 03:54 AM
Message Edited by mazhar.ali on 02-18-2009 03:56 AM
Message Edited by mazhar.ali on 02-18-2009 03:59 AM
0 Kudos
Message 5 of 10
(4,481 Views)

now in this post i want to set my coordinate(mouse down value) to the narest grid on xy graph

xy graph has multiple plots in my case(data type of graph is array of clusters containing two arrays x array and y array)

it seems that your reply is correct but can you eloborate more and you also talked about some "math" plz tell me more because that was insufficient for me

thats why i have asked about example vi  

 thanx in advance

 

regards

mazhar

0 Kudos
Message 6 of 10
(4,471 Views)

 

really smart answere thanx semercurio_fc

 

similarly for Y point.

after short practice i got the "math" and fix my problem.

i think you are "Jin" .

 

regards

mazhar

Message Edited by mazhar.ali on 02-18-2009 06:04 AM
0 Kudos
Message 7 of 10
(4,464 Views)
Um, err... It seems that I may have been responding to your queries telepathically because I certainly don't remember giving you the final answer. Smiley Very Happy It does appear that you have the solution, though.
0 Kudos
Message 8 of 10
(4,447 Views)
yesterday  i didnt feel like thinking
0 Kudos
Message 9 of 10
(4,445 Views)
Yeah, that happens to me more often than I care to admit. Smiley Very Happy
0 Kudos
Message 10 of 10
(4,437 Views)