LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How to align digital values with XYgraph legend

I have a labview vi that puts up multiple XY graphs with time for the X axis and other data like temperature (on one graph) or strain (on another graph) for the Y axis.  I have the graph legend turned on (and have it placed in the upper right corner of the graphs, just off the corner of the graph itself) and it shows the name of each of the multiple data channels along with a legend of what each plot looks like (line style, point style, color)...  So far, so good...  But I also generate (elsewhere in the code) a cluster which contains the digital number that represents the current value of whatever channels are being plotted...  I've made a type def out of this cluster and worked over time to size it such that when I place it right next to the plot legend (discussed above) you see this plot legend showing channel names, plot colors and so forth and just to the right of that you see this vertically arranged cluster of current digital values of what is being plotted...  

 

But I have found it next to impossible to come up with a scheme that allows this to stay in alignment...  I work hard, build it to look right on my machine...  Then I build an executable and move it to another machine (with a different monitor resolution and so forth) and the legend overlaps the digital display or the other way around and neither ever stays in the correct proportions vertically...  The bottom line is it's a mess...  I even use property nodes to carefully state where to place the top and left edge of the XY graph and also where to place the top and left of the digital value cluster...  But it's really the XY chart legend that I just can't control...  It changes shape and size and position as I run code that has different channels names (shorter/longer) and everything just gets messed up...  Plus moving an executable to another machine with a different monitor resolution just makes everything even worse... 

 

Surely there is some reasonable solution to this that I am missing...  Can someone please point me to a way to make a display where an XY graph, its associated graph legend and a cluster of digital values can all sit nicely together in a way that presents a reasonable display to an operator????  This is an old problem that I've fought for too long now...  Please help if you can...  thanks... bob...

0 Kudos
Message 1 of 13
(4,770 Views)

Hello paris1,

 

I think you are correct in identifying the screen resolution as a problem here.  If you wish to "dock" your cluster to the top right of the you can try using the Top, Left, and Width properties of the XY Graph legend to programmatically set the position of the cluster at run time.

 

The attached subVI uses the legend properties, but you can do the same for the XY graph as well.  Also note that the top property of the cluster is adjusted if the label is visible or not.

 

 

Anthony F.
Staff Software Engineer
National Instruments
0 Kudos
Message 2 of 13
(4,746 Views)

Silly me...  I didn't even think to investigate whether the graph LEGEND itself had similar placement properties...  Flew right past that...  Thanks for the suggestion...  I am about to go look into whether that will work for me...  I still have a separate but related issue of the vertical extent (we've to this point been talking about horizontal placement) wherein I can't get the vertical height of my multi-indicator cluster to line up vertically with the corresponding vertical extent of the Graph Legend when switching from my source computer (and it's monitor resolution) to the target computer and it's resolution...  And remember I build executables to deploy on the target so it becomes trial and error which is pretty painful...  But first things first....  I will go work on your way to hopefully align things in the horizontal plane...  Thanks much for the feedback...

 

bob...

0 Kudos
Message 3 of 13
(4,732 Views)

Hi...  You said,

 

"The attached subVI uses the legend properties, but you can do the same for the XY graph as well."...  

 

But I am having a hard time finding the right side of the XY Graph itself...  I have tried using the property,

 

Bounds, Area Width

 

and adding that to the value for the Left side of the XY graph...  But that doens't work and I don't know why...  Obviously I don't understand the real meaning of "Bounds, Area Width"... 

 

The bottom line is I want to be able to locate the right edge of the XY graph so I can place the left edge of the Graph Legend at that point and then I want to be able to add to that point the width of the Graph Legend so I can place the left edge of the digital display cluster there... 

 

You certainly helped me by showing me the Legend Left and Legend Width...  And I already knew about XY Graph Left...  But what is missing from that picture is the one other needed parameter, the XY Graph WIDTH...  I thought perhaps the "Bounds, Area Width" was that but it isn't....  It seems simple but I can't seem to locate it...  Is there a property for the WIDTH, from the left edge which I know to the right edge of the XY Graph???  Or, just as good, is there a property for the Right Edge of the XY Graph???  I just need to locate that specific edge (right edge of the XY Graph itself)..  What am I missing????  thanks... bob...

0 Kudos
Message 4 of 13
(4,722 Views)

Paris1,

 

Maybe your plot legend is getting in the way of the Area Bounds property.  In this case you should use the Master Bounds Rectangle and unbundle the right property of the XY graph.  See attached how the plot legend affects the Area Bounds.

Anthony F.
Staff Software Engineer
National Instruments
0 Kudos
Message 5 of 13
(4,705 Views)

Anthony...  Everything you've offered so far has been very helpful...  Thanks...  Let's see if this one more issue might have a resolution...  What you've already helped me with helps resolve how to do what I will call the "horizontal alignment" but I still have one "vertical alignment" challenge...  When I build the code on my source machine, even if I set the resolution of that source machine to the same resolution as the target machine, when I align the XYGraph Legend (vertically) with the cluster of digital indicators (again in the vertical plane) when I then create an executable and move this to the target machine, clearly the FONT on the XY Graph Legend has changed certainly in size (gotten bigger) and it would appear in FONT as well while the numerical values in the cluster of digital indicators does not appear to change.  So I end up with an XY Graph Legend that is far "taller" than the cluster of digital indicators I want it to align with...  

 

Is this a LabVIEW.ini file issue or what???  How do I get fonts and font sizes to move from source to target such that they stay the same size between the two??

 

As always, any help would be much appreciated...  thanks...  bob...

0 Kudos
Message 6 of 13
(4,692 Views)

I mentioned earlier that the labels would interfere with the TOP property.  I am having a difficult time understanding if this is the exact problem or not. Can you post a screen shot of it aligned correctly and a picture of it not aligned?

Anthony F.
Staff Software Engineer
National Instruments
0 Kudos
Message 7 of 13
(4,689 Views)

The tops look like they are staying where I want them...  And do note I have intentionally put in a slight offset in one of the TOPS so I get the best alignment all the way down the list...

 

Instead it appears that the FONT for the XY Graph Legend grows by a lot while the digital display stays smaller...  So somehwere (some .ini file??) the target machine is picking up font information that I need to figure out how to control or change, at least that's my thought...  See two jpgs attached as you requested...  bob...

0 Kudos
Message 8 of 13
(4,685 Views)

Paris1,

 

Thanks for the screen shot, I was completely wrong about what the actual problem was!

 

This is caused because LabVIEW will use the system default font styles unless you specify another.  Try to force it by selecting both a font name, and size after clicking the plot legend.  Choose a common font or LabVIEW will default back to the system default.

 

 

Anthony F.
Staff Software Engineer
National Instruments
0 Kudos
Message 9 of 13
(4,656 Views)

Hi...  I've just about got it now...  Everything you've passed along has been helpful and I am now able to properly place chart legends just to the right of charts (well all but in one case but that's another investigation)...  But basically I've got that part working for the most part...  and I can now always place my digital display in the right position just to the right of the chart legend, again based on all the input you gave me...  But I've run into one more very frustrating problem... 

 

I automatically create more and more charts based on how many sensors I am trying to monitor...  And to the best of my ability I have now set up all these possible charts to use the property concepts you passed along to me...  Find attached four jpgs...  They show the right side of four XY graphs with the legend and my digital display showing...  The first one, Chart1, is perfect, just what I want...  But notice in Charts 2, 3 and 4 how the text in the chart legend progressively disappears as the chart legend itself gets narrower and narrower...  I have no idea how or why that is happening...  The one in charts 2, 3 and 4 should look just like the one in chart 1 but with different sensor names... 

 

What property is it that is causing these chart legends to clip text that clearly should be there????  Your thoughts???

 

thanks... bob...  See 4 attached jpgs...  hmmm...  Upon further review it appears I can only attach 3 items but that's ok, you get the idea...  The 4th one is just chopped even worse than the third such that you can barely see any text at all...  So see 3 attached jpgs...  thanks...

0 Kudos
Message 10 of 13
(4,624 Views)