Jump to content

Graph cursors displayed against wrong Y-scale


Recommended Posts

Hi,

 

My graph is a XY Graph but the X-scale is just the time. I use the XY Graph in order to define the time stamp of each sample. I use cursors that I snap to the plots in order to display the plots' names. Everything works well when all the plots are displayed against Y-scale 0. But when switching a plot to Y-scale 1, the associated cursor keeps moving like if its plot was still on Y-scale 0. Simply dragging the cursor with the mouse a little bit snaps it to its plot properly (value displayed against Y-scale 1).

 

I tried using the Cursor.YScale property of the cursor but it doesn't seem to help.

 

Has any of you encounter this issue?

 

I am using LV 2011.

 

Thanks!

Link to comment
  • 2 weeks later...

Reproduced on LV2013. See attached VI. Changing the Y-scale of the plot during run-time should reproduce the problem. It seems that the cursor's y-scale is not updated until you move the cursor manually.

 

Reproduce%20Bug.png

 

A workaround is to catch the plot attribute change event and update the cursor list manually. I've implemented this in the attached VI. Enable the Fixit? button and then change the plot's Y-Scale and the cursor should snap to the correct scale.

 

The attached VI is saved back to version 2011. Let me know if it works for you.

 

Ok... I can't attach files... Here it is in dropbox: https://dl.dropboxusercontent.com/u/8640811/XY%20Graph%20Bug/XY%20Graph%20Cursor%20Test.vi

  • Like 1
Link to comment

Just tested it within my code. It works! But what made it work is setting the X-position to 0. I removed the update of the Y-scale property of the cursor and it still works. On the other hand, if I leave the Y-scale property and remove the X-position of the cursor, the fix no longer works.

 

It's strange, I would expect the X-position to be useful in Free mode only, since I use the Index property to specify the point of the plot to snap the cursor to...

 

Anyway, thanks again Porter, this bug had been bothering us for weeks...  :worshippy:

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.