Programmatically expanding label space in Plot Legends

I know that manually expanding the Plot legend with the left corners expands the label area. How do I do the same thing programmatically? Changing the width property seems to add space to the right side.

According to the Help File entries for those properties the size properties expand or contract from the right side. Mike...
Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion
"... after all, He's not a tame lion..."
Be thinking ahead and mark your dance card for NI Week 2015 now: TS 6139 - Object Oriented First Steps

Similar Messages

  • How do I programmatically change the plot legend names on my xy graph?

    I have a need to change the names/labels on my XY Graph's Legend at run time.  This is because plot 0 is not always the same set of data.  I have searched high and low for a couple days now to no avail.  The closest thing I've seen is overlaying a string over the plot legend, but I would prefer to do change the property of this box.  Any help would be appreciated.

    Hello Ben,
    with waveforms this also works for me fine. So where is the pitfall? (if always all works fine, one don't really gets experience)
    greets, Dave
    P.S. @ J.B. I used the Code Capture Tool from the Starware Thread, this made me so fast. If I could do, I would give it five stars each time I use it.
    Btw. would it be possible to programmatically give ratings with LV? Here it should be used. Thanks again to tst & the others
    Message Edited by daveTW on 06-14-2007 09:13 AM
    Greets, Dave
    Attachments:
    Example_FP.png ‏5 KB

  • Automatically labeling plot legend using XY Graphs?

    I want to plot:
    Time Amp
    1       2
    2       4
    3       9
    How do I get the legend to automatically say Amp, instead of Plot 0? I went to property node -> legend and I don't see any option
    that would read the "column" header and label the legend accordingly.
    In my example, the X array (Time) and Y array (Amp) are fed into Bundle which is then fed to the XY Graph input. The X array (1,2,3) and Y array (2,4,9)
    obviously carry no information about their respective column names (Time, Amp). So, the legend must read this information separately, but I don't know
    how to feed this information to the plot legend. 
    Solved!
    Go to Solution.

    You simply need a property node for "plot.name". You have only one plot, so the following is sufficient (of course you would replace the string diagram constant with whatever you read from the column header in the file)
    (If you have several plots, you would do it in a loop, setting the active plot from the iteration terminal, first, then writing the name)
    Since this is an xy graph, I would actually hide the legend and simply label the two axes according to their header. This can be done in a similar way with property nodes. See if you can figure it out.
    (Of course if the labels never change, enter them once manually and they will be saved with the VI. No code needed.)
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    SetPlotName.png ‏3 KB

  • Numeric indicator label used to create plot legend

    When I create a channel for data (numeric indicator) it carries along with it a name for the value.  So for example if i am reading 8 temps, I name them temp #1, temp #2, etc.  How can I have those names carry through into the plot legend?   Thyey only show up as plot 0, plot 1, etc.
    Does it matter if it is a chart or graph?

    What makes you assume that some scalar indicator label information would flow upstream and somehow end up as plot labels?
    All you need to do is write the desired plot names once at the start of the program, e.g. as in the attached modification.
    You currently have duplicate control labels, so that's something you should fix.
    Sorry, I don't have DAQmx installed, so I cannot help with the assitant. Still, maybe the attached can give you some ideas....
    LabVIEW Champion . Do more with less code and in less time .
    Attachments:
    RTD Bearing ComparisonMOD.vi ‏74 KB

  • Programmatically formatting the active plot and plot legend

    I am monitoring 6 production sequences on an XY graph. A ring control selects which sequence I show on the graph. For each sequence I have tag data showing the "actuals" and tag data showing the "averages" and a boolean toggle switch controls which of these plots I show on the graph. I am having trouble controlling the formatting of the plots (both actuals and averages are currently shown in white) and the plot legend is wrong. I have tried programming my vi to format my plots using a property node from the XY graph and writing to the correct plot inputs, however it doesn’t seem to be working. I would also like the plot legend to show ONLY the active plot on the XY graph.
    I would like a red continuous line for the averages and blue square scatter points for my actuals. I can’t seem to get this at all. I have attached my vi if anyone can help?
    Many thanks for taking the time to help,
    Best regards,
    Stuart
    Attachments:
    Historical Handling Time Trends.vi ‏137 KB

    Hi Stuart
    Maybe this helps you.
    Thomas
    Using LV8.0
    Don't be afraid to rate a good answer...
    Attachments:
    Plots.vi ‏65 KB

  • Start position on plot legend scrollbar

    If I right click on the plot legend I can show the index display and vertical scrollbar. When I move the scrollbar the index changes accordingly. Does anyone know how to programmatically find the value of this index so that I know which plot labels the user sees. I've tried looking at the property node but I can't see anything that gives me what I need.

    Thanks for your reply Rob.
    I was thinking that was the case. Sometimes it’s possible that there are clever little tricks hidden away in the set up screens. I’ve ended up now with my old method which looks very clumsy (see attached vi), I can make it look much better when I get the scroll bar position.
    I’ll follow up on the product suggestion though as it would be a very useful feature.
    Attachments:
    Scrollbar Demo.vi ‏52 KB

  • How to remove entries from the plot legend?

    Hello,
    I have got a waveform graph to display measurement data. Sometimes there will be 40 plots shown. The plot legend also expands to 40 and I limit the number of elements shown in the Plot legend and I have activated the vertical scroll bar. Of course 40 plots are too many to work with. So the user has the ability to select plots to be shown. Now I want to decrease the number of elements in the plot legend as well. But if there were once 40 elements the plot legend remains in this size and the vertical scroll bar indicates that there are more elements than shown even if there are only e. g. two plots in the graph.
    I don't want to increase and decrease the number of plots shown in the plot legend programmatically each time the user changes the number of plots shown. Secondly the plot legend shall have a maximum number of 20 elements (otherwise it would exceed my front panel). So I don't want to programmatically check whether to show the vertical scroll bar or not.
    The legend should look like a partially filled array with grayed out elements. 
    How do I do this? 
    Is there a simple way to clear the plot legend and remove all entries?
    Regards, Jörn

    Hi Suse,
    your example does not exactly solve my problem. I wanted the plot legend always to show 10 legend entries.
    But it helped me to find the solution: set LegNumRows to 10 and set LegPlotMin to the number of plots in the Graph (see attached example).
    One thing is still missing: setting the plot number currently at the top of the legend. If you run the attached example with 30 plots shown, scroll the legend down and run the VI once again with 3 plots shown then you will see no plots in the legend despite the fact that all could be shown. You need to move the scroll bar first to see the 3 elements.
    Best regards, Jörn
    Attachments:
    Graph_Plotanzeige.vi ‏12 KB

  • How to remove a plot and resize the plot legend in LV 8.6 as in this link to a LV 7.0 example

    This VI ( ftp://ftp.ni.com/pub/devzone/epd/201150.vi ) works exactly as I want an 8.6 application to - but the property node used in the example is no longer supported.
    I can add/remove plots and resize the plot legend with 8.6 using the "LegNumRows" property however this property does not appear to behave the same way.
    It seems this should be straight forward but I must be missing something.
    Solved!
    Go to Solution.

    Hi again!
    I have implemented a method to shuffle the plots in the legend and was satisfied with one exception- the plot colors. This application allows the user to add or delete plots from the graph, adding a plot is easy as the new plot name gets appended to the next place on the legend and the number of rows grows by one. Deleting a plot is also quite easy but this action brought up a usability issue in that the existing plots that were shuffled on the legend would also shift their colorsaccordingly. To eliminate possible confusion I want to keep the correlation between existing plots and their assigned colors so I tried to use the plot color property to change the plot color programmatically with unexpected results.
    Programmatically changing a color from the "Plot Colors" array does not change the color of that plot if it is set to any of the "Common Plots" wih the exception of "Common Plot 0" - i.e. this doesn't seem to work for Bar Plots which is what I am using.
    I have attached a demo VI to illustrate this behavior - there are detailed free labels on the front panel which describe this in more detail.
    Regards and thank's in advance!
    Attachments:
    Plot color behavior.vi ‏27 KB

  • Why do waveforms show garbage in the plot legend and why is no one mentioning this?

    I have tried this on multiple machines and the result is the same. The plot legend expands and shrinks with garbage characters each time the waveform is updated.
    Sometimes the plot legend expands to as many as 100 garbage characters (or more). Is NI aware of this?

    Hi Ben
    Ok I managed to get a small enough version of it to zip it up and show what happens. I hope the demo is intact enough to show the plot legend.
    just run the VI "0_bloat-OVEN.vi"
    It uses a simulation file for the waveform but if u have a DAQ bd just uncheck the "Simulate DAQ bd?" button.
    Ive seen this on 3 machines now WIn 98 WIn XP and Win2K.
    Attachments:
    WF-PlotLegend.zip ‏778 KB

  • Plot legend flicker when in RUN mode

     Hi all,
    i have written a code in LV to acquire data from 12 sensors and display them. In the waveform chart I tried renaming the legend. When I run the vi, the legend name flickers to module name and channel name. I am attaching a snapshot to give you guys a clear idea.
    The vi is also atttached.
    Any help is appreciated.
    Regards,
    Arihant
    Attachments:
    plot legend issue.png ‏46 KB
    Temp meas using DAQmx.vi ‏39 KB

    I think it's flickering because you placed the code that writes the plot labels inside the while loop, so at each iteration you re-write it, just place all that code before the while loop, so that it executes only once before you get into the loop.
    And also since you're using waveforms, DAQmx automatically includes metadata with your channels, if you want you have to remove those metadata plot by plot.
    You can also optimisze a bit the code to write all the plots' names. See attached VI.
    Hope this helps
    When my feet touch the ground each morning the devil thinks "bloody hell... He's up again!"
    Attachments:
    Temp meas using DAQmx.vi ‏29 KB

  • Plot Legend Ordering

    I am having a small, but frustrating problem in a LV app. I have a waveform chart that has a plot legend that is assigned programmatically. I assign the names with a property node of plot.name. The plot legend names are assigned in numerical order. I can add another element set to read and it shows the names in numerical order. I also set the active plot and the length of the plots.
    The legend is not displayed in order and the plots are all off by one. The last one is actually the first one. The first one is actually the second one.
    Any ideas?
    TIA
    James

    Thank you Joe!
    So this could also be the result of the active plot being set set AFTER (i.e. lower in the property node) the name is set.
    So (imagining now) if a for loop is used to do the naming and the active cursor is the last when the loop starts, the first name would be applied to the last active plot. Then the active plot gets set to "0" in prep for the next iteration.
    Just guessing.
    So if this is the case, the fix would be to change to order in which the properties are manipulated in the property node (they execute top to bottom).
    So thanks again joe for "the kick in the head"!
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction

  • Changing the Plot Legend (NonSequential Names)

    I've got a Chart that serves multiple purposes.  As such, the plot legend needs to change.  I've looked through the forums, and have found options that let me create a dynamic legend of the form (Name1, Name2, Name3).
    However, I don't want the labels to be sequential in nature.  I'd like to be able to define the legend as either (x,y,z) or (A1,A2,B1)
    Any suggestions?
    Thanks!

    You have the option to change the scale label through the property node, using that you can set any name you want. Is that what you are looking for?
    The best solution is the one you find it by yourself

  • Synchronizing a listbox and a plot legend

    Hello all,
    I'm working on some code where I would like to be able to select/deselect as many as 50 plots on an XY graph.  Because of the relatively large number of plot names, it makes sense to place them in a scrolling legend or listbox. 
    Problem is (as far as I know) the plot legend can't be used to *easily* make plots disappear and appear with a single click-- one must right click, go to colors, and select transparent, etc. then reverse the procedure to make the plot reappear.
    An alternative might be to use a list box 10 rows long as the master indicator, then use some of its properties to create a dynamic plot legend borrowed from a second hidden graph.  This plot legend would reconfigure its line/symbol colors dynamically based upon the where the user is within the scrolling listbox.
    One problem I've encountered is that the Label.ScrollPosition property will not write out to an indicator for me.  Please see the example code.
    Top row provides some feedback from the listbox, but not enough info to do the job properly.
    Any thoughts?
    Regards,
    Ted
    Solved!
    Go to Solution.
    Attachments:
    scrolling listbox Row numbers.vi ‏16 KB

    Hi to know the position of the list box element...
    try this...
    <<Kudos are welcome>>
    ELECTRO SAM
    For God so loved the world that he gave his one and only Son, that whoever believes in him shall not perish but have eternal life.
    - John 3:16
    Attachments:
    scrolling listbox Row numbers.vi ‏18 KB

  • How do you programmatically switch between a stack plot and an overlay plot with a waveform control?

    One method i realize is to have two waveform controls, one visible and one not visible. The real issue here is, how to dynamically control the number of plots in a stacked plot. My case,
    i will have between 2 and 8 channels. I have found that in the properties if i set the number of plots - Legend--Plots shown . I can control the number of stack plots, however, i must toggle from overlay to stack plots in design mode for the correct number of stack plots to be shown. Does anyone know a way around this problem or know of the property that has alluded me?

    Hi,
    You cant select between Stack plot and Overlay programmatically. Well not in LaBVIEW 5.1.1.
    You could have two Charts, one set up for Overlay and the other setup for Stacked. Then hide the one you are not immediately using.
    Ray.
    Regards
    Ray Farmer

  • How can I limit the vertical size of the plot legend?

    Hi all,
    in my program I use a waveform graph and its plot legend.
    My problem is that the vertical size of the plot legend increases out of my frame and screen if I add too many plots to the graph!!!!
    Is there a possibilty to limit the vertical size of the plot legend and/or to use a vertical scrollbar in the plot legend?
    I use LV 8.2.1 .
    Thanks
    daHans

    You can write to the "Active Plot" property node. The example given in the thread I linked to before shows using this. Did you take a look at that example?
    I'm only suggesting the alternative of an "Active Plot" control if you're trying to give the user the ability to manipulate one of the plots (like color, point style, etc). If you have a lot of plots, and the plot legend is too big, you can provide a numeric control where the user selects the plot, and then additional controls to set the properties for that plot. Not as intuitive as the plot legend, but if that's what you've gotta do, that's what you've gotta do. Attached is a simple example (LabVIEW 8.20).
    Attachments:
    plot.vi ‏21 KB

Maybe you are looking for