Jump to content

Cursors Shifting on XY Graph


Recommended Posts

I am writing an app to output a .csv file to an XY graph indicator. It contains a list box that allows 1 or more plots to be selected and displayed. I finished the app, and everything worked as it should, but I couldn't get over how bad the cursor legend looked on my front panel. For example, the column headings are bolded in the cursor legend. There is no other bolded text on my FP. I made an attempt to edit the appearance of the cursor legend, but was unable to figure it out. It seems the cursor legend is all one image in the control editor.

I decided to make my own cursor box. I made a multicolumn listbox that matched my FP nicely, and added the functionality to add and delete cursors from the list. Eventually I got everything working, but in my testing, I've noticed that every time I add a new cursor, the old cursors shift one X value to the left on the graph. I have been unable to find any reasonable explanation for this behavior, and I'm wondering if anyone else has seen and fixed a similar issue.

When the Add Cursor event is called, the cursor is created. Next, I redraw the graph by resending the same values already being displayed. This may not be necessary, and seems to be the source of the issue, but it was the only way I could find to make the new cursor appear. Without redrawing, the cursor would be created (I confirmed by aborting and checking cursors tab on graph properties), but it would not show on the graph. Using highlight execution, the shift happens during the Update Graph state when the graph is redrawn, not when the new cursor is actually created.

I've attached an image of my Update Graph subvi. It seems pretty straightforward, which is why I'm a bit confused by the issue. The true case just passes an empty cluster to the graph as a placeholder for non-selected plots. Any suggestions are greatly appreciated. I would be willing to ditch my cursor box completely if I could find a way to modify the existing cursor legend.

post-13866-1241106922.png?width=400

Link to comment

QUOTE (ShaunR @ Apr 30 2009, 12:07 PM)

You can change the cursor legend font as with any other indicator/control.

Just set the font of the cursor legend to "Plain". Then they won't be bold.(If that's all you need to acheive).

There are some other things I don't like about the looks of the cursor legend, but I can make the rest of my FP match the style and be done with it. Thanks for pointing this out.

EDIT: I'm not seeing the property for this. The only font properties I see that are associated with the graph are the label and scale fonts. Am I missing something?

Link to comment

QUOTE (ejensen @ Apr 30 2009, 02:02 PM)

EDIT: I'm not seeing the property for this. The only font properties I see that are associated with the graph are the label and scale fonts. Am I missing something?

It doesn't exist. When you customize an XY Graph, you can see it's not selectable (not text). The Cursor Legend properties do not include Font properties, nor private properties (I checked).

You can change the fonts of the cursor name, but not the title "Cursor/X/Y".

Link to comment

QUOTE (normandinf @ Apr 30 2009, 04:30 PM)

It doesn't exist. When you customize an XY Graph, you can see it's not selectable (not text). The Cursor Legend properties do not include Font properties, nor private properties (I checked).

You can change the fonts of the cursor name, but not the title "Cursor/X/Y".

Thanks for confirming this. Your suggestion above would work except I'm not sure if/how that would handle resizing the column headers. If I were more familiar with using the custom controls editor, I would be more willing to give that a shot. I decided to just make the rest of my FP match the cursors legend and use the built-in cursors functionality. I don't like the way it looks, but it is functional, and that's what matters.

I'm still not sure why my other method was shifting the cursors, but that's a problem for another day. Thanks again.

Link to comment

QUOTE (ShaunR @ Apr 30 2009, 06:02 PM)

Please indulge us!!! :thumbup:

Which property do you use...?

QUOTE (ShaunR @ Apr 30 2009, 06:02 PM)

Right...lol

So it must be impossible to do this then
:)

Oh, I see.

Simply select the cursor legend on the front panel and choose the font from the ring menu...

At least I wasn't stupid... the property doesn't exist for doing it programmatically.

I should have checked if the computer was connected before I complained about the black screen!!!! :P

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.