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

Similar Messages

  • How to Generate Event on change in Plot Legend for XY Graph

    Hi,
    I have two XY graphs on the front panel and would like to maintain a common plot legend such that any change in the plot legend affects both graphs.
    Objective: I would like any value change in plot legend to fire an event.
    How do I program that?
    I know of value change event for the graph but am unable to find something specific to the plot legend. Other option is to have the user press a "refresh" button that will fire the event.
    Feel free to share thoughts on other elegant methods to achieve the same objective.
    Thanks,
    Gurdas
    Gurdas Singh
    PhD. Candidate | Civil Engineering | NCSU.edu

    Hi Sarah,
    Looks like you are talking of exactly what I want!
    I have attached a sample VI to try achieve what I want. But it still has some issues which are:
    1) I am unable to configure a Plot Attribute Change Event. I have used a mouse leave event instead. How does one configure a Plot Attribute Change Event?
    2) Is there no single property which will transfer all the settings of plot legend from one graph to plot legend of another graph? In my sample VI, I have to read each property of the master graph and feed it into the slave graph.
    Kindly note I am using LV FDS 7.1 on Win2000
    Thanks,
    Gurdas
    Message Edited by Gurdas on 03-27-2006 11:51 PM
    Gurdas Singh
    PhD. Candidate | Civil Engineering | NCSU.edu
    Attachments:
    Graph_PlotLegend_Event.vi ‏45 KB

  • Rotate Plot Legend of XY graph

    Is it possible to rotate the plot legend so the letters of the plot names run from bottom to the top rather than across the operator interface?
    The names for my plots are bigger and I need to show at least four plots at the same time. Putting scales to the right/left/above or below without rotating may cause a shorter XY graph! 
    Any ideas for me?
    Regards
    K Waris
    Solved!
    Go to Solution.

    Hi,
    I don't know if there is a native way to do it, but you can "cheat" to do that:
    You can move the array where the legends are, or even make the array grow into lines instead of column.
    Is the idea ok for you?
    Giuliano Franchetto
    Student at the l'Ecole Nationale Supérieure des Mines de Saint-Etienne, cycle ISMIN (FRANCE)
    Attachments:
    up to dowm legend.vi ‏17 KB

  • Horizontal scrollbar for plot legend

    Hello,
    The plots in my plot legend for a graph can have quite long names so it would be great having a horizontal scrollbar.
    Quote from here
    >>To add a scroll bar to a plot legend, right-click the plot legend and select Visible Items»Horizontal Scrollbar or Visible Items»Vertical Scrollbar from the shortcut menu.
    I can see the entry horizontal scrollbar, but it is always grayed out, what's wrong?
    Thanks a lot for your help!
    Cheers,
    Rico

    I think you are misinterpreting the use of the scrollbar.  If you have a lot of plots on your graph, then you can use the scrollabr to not show all the plots at once and this allows you to scroll through the list.  It does not allow you to make the plot legend smaller to hide long names and scoll across.
    So, if you resize the plot to be horizontal, then you can display the horizontal scrollbar:
    If you resize it vertically, then you can display the vertical scrollbar:
    Message Edited by Matthew Kelton on 05-09-2008 12:09 PM
    Attachments:
    Plot legend horizontal.png ‏2 KB
    Plot legend vertical.png ‏2 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

  • 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

  • How to make use of the Legend from XY graph?

    The hardware i am using will create a plot everytime i do a scan. I will upload the it result(plot) to another XY graph. I try to create a multi plot on the XY graph but it seems not working. I am wondering how can i make use of the legend that come with the XY graph to solve my problem.

    Hi,
    You should be able to plot as many XY arrays to the graph as you need. As long as you don't delete the previous plots they should remain there. This will make things much easier than dealing with 2 graphs.
    There is an example at "C:\Program Files\National Instruments\CVI70\samples\userint\graphlegend.cws" that you can look at for an application with multiple plots.
    I hope this helps.
    Regards,
    Juan Carlos

  • Strange Fonts in labview graph's plot legend.

    Hello All,
        I am running labview 7.1 on a Windows XP machine and
    the default and only language is English (US). Verified this under
    Control Panel > Regional Settings.
        When I run a VI, I get strange fonts in the plot
    legend. They keep updating as the VI runs. Here is a screen shot of the
    plot legend:
    I change the font to something I can read, save the VI and run it again
    and it automatically changes to this unreadable font again. Any ideas
    on what I can do? Thanks.
    KB

    Is it just the font that is off, or are these actually non-printable characters?
    Are you graphing e.g. dynamic data types? Do you possibly have weird names for your signals?
    LabVIEW Champion . Do more with less code and in less time .

  • Waveform graph plot legend in labview 8.5 won't respond to arrow keys?

    I heard labview 8.5 fixes most of the problems that plague 8.2, so I recently installed it to try it out and see if it is worth the effort of another upgrade.  Messing around today, I found an issue that wasn't related to the installer itself.
    The plot legend on a waveform graph doesn't appear to respond to arrow keys for precise placement.  It doesn't matter whether auto-size plot legend is turned on or off.  When I want to place a plot legend very precisely, just like with any other labview control I like to use the arrow keys to get things perfectly aligned.  I want to make the plot legend perfectly in the corner of the graph but its very hard to get it placed right with just the mouse.  In labview 8.5 it seems like plot legends no longer respond to arrow keys.
    Can anyone confirm this or know of a way to precisely place the plot legend in labview 8.5?
    -Devin
    I got 99 problems but 8.6 ain't one.

    Ben,
    I checked the snap to grid hypothesis. Even when activated the arrow keys still allow an accurate positionning of the objects at pixel level.
    That's so nice that I changed my setup. I now have a reasonnably large spaced grid (50 pixels) with an invisible grid (contrast adjusted to zero). That should make object positionning and dimensionning much faster than before.
    Chilly Charly    (aka CC)
             E-List Master - Kudos glutton - Press the yellow button on the left...        

  • Changing Graph Plot Legend

    I have no problem changing a normal graphs plot legend with a property node, but I'm trying to display three different sets of data on one graph.  I tried doing it using a plot reference with the Plot Legend and using Caption Text.  They should be settable when the VI is running, but the way I was trying to do it I got a reference error (1055 Reference Invalid).  Setting either the Plot Legend or Caption Text would be acceptable if I could just figure it out.
    I'm trying to display 32 spectrums, but only use 8 graphs and have the name of the particular channel change.  Doing this without doing an FFT the channel name gets brought into the graph, but when I use the Power Spectrum VI I don't have the Spectrum Info wired into anything.  So, I'm bringing my original channel name array over and trying to do an iteration to pick the correct plot reference and channel name.
    I've extracted only the part of my code for this question, so hopefully it is easy to look at what I'm doing.
    The first VI and SubVI are functional.  The second SubVI is where I was attempting to change the Caption Text.  I've tried other things too, but I just wanted to show one way I was attempting to do it.
    Solved!
    Go to Solution.
    Attachments:
    Part of Analyzer - Displaying Graph Legend.vi ‏1432 KB
    Calc Channel Indices 1_35.vi ‏27 KB

    I don't have the SV add on so I can't check out your main program. I looked at your sub vi and you're doing more code than you need to. Take a look at my example, I've put your 8 graphs into a cluster then used an array of references along with arrays for your chanel indecies. Maybe it can give you some ideas for your program.
    Attachments:
    Calc Channel Indices 1_35 mod.vi ‏766 KB

  • 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

  • Is it possible to make a graph with drag and drop plots and use it as a control?

    I am trying to make a graph with multippel plots to use as a control, the plots should be drag and drop. Is this possible in LV 7.0 or do i have to use c++ or WB?

    I second Doc-Doc comment. I am not sure what you are asking.
    The attached is an example I found on the NI web-site some time ago. I cannot find the link again so here is a ZIP of what I found in a temp folder on my machine.
    Trying to help,
    Ben
    Ben Rayner
    I am currently active on.. MainStream Preppers
    Rayner's Ridge is under construction
    Attachments:
    WF_SketchPad.ZIP ‏67 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

    Hi,
    I use a case structure to display or hide a plot to a xy-graph. It is the 4th plot of the graph, so the plot legend automatically gives its name as Plot 3. Then I change the name to what I want it to be. But after I hide this plot, and then bring it to display, the plot legend go back to Plot 3 again. How I can assign the name to this plot permanently?

    Hi,
    You're not making the name invisible. You're creating a new plot.
    Doing a quick and strange thing (cause i got to dinner), you can solve your problem with the changes that I'de made.
    Software developer
    www.mcm-electronics.com
    PS: Don't forget to rate a good anwser ; )
    Currently using Labview 2011
    PORTUGAL
    Attachments:
    Plot%20Legned%20Example[1].vi ‏23 KB

  • WPF Legend Binded to Graph.

    Hi,
    I have a ni:Legend object binded to the Plots of my Graph object. Which Property of my Plot should I set from the C# code to see it displayed in the Legend window?
       <ni:Legend Name="MyLegend" ItemsSource="{Binding ElementName=MyGraph, Path=Plots}" />
            <ni:Graph Name="MyGraph" DataSource="{Binding UpdateSourceTrigger=PropertyChanged}">
                <ni:Graph.Plots>
                    <ni:Plot/>
                </ni:Graph.Plots>
    </ni:Graph>
    MyGraph.Plots[0].??? = ???
    Solved!
    Go to Solution.

    The legend uses a WPF ContentPresenter to display the plot Label property. In the case of UI elements, it appears that ContentPresenter defaults to using the ToString representation, instead of the element itself.
    To display content like "Something", you will want to assign that content directly to the plot Label property:
        MyGraph.Plots[0].Label = "Something";
    If you want to specifically show a WPF Label content control in the legend, you can use the LabelTemplate property:
        <ni:Graph.Plots>
            <ni:Plot>
                <ni:Plot.LabelTemplate>
                    <DataTemplate>
                        <Label Content="{Binding}" />
                    </DataTemplate>
                </ni:Plot.LabelTemplate>
            </ni:Plot>
        </ni:Graph.Plots>
    ~ Paul H

Maybe you are looking for

  • OutofMemory error while uploading a file

    Hi! I am using the jsf upload component as follows: <hx:fileupload styleClass="fileupload" id="fileupload1" value="#{pc_Infosession.pj1}">        <hx:fileProp name="fileName" value="#{pc_Infosession.pj2}" />       <hx:fileProp name="contentType" valu

  • HP Color LaserJet CP1518ni STOPPED WORKING!

    Will the print driver for HP Color LaserJet CP151ni be included with the MAC OS X 10.6 updates anytime soon? I just bought this printer two months and what a waste if it will not be supported by the updated OS. Really disappointed! Need to print....!

  • How to use "used webdynpro components" in nwds 7.0

    hi all, I am using NWDS 7.0 SP8 version. I want to use my local DC1 in my local DC2. I have created public part of DC1 and integrated it into DC2 as used DC. But when I try to add the webdynpro component from the Used Webdynpro Components of DC2, I a

  • How to replace a whole website

    I recently redid a whole website for a friend and want to take all of his old web site down and replace it with mine which is currently stored on my computer, can someone tell me the steps of how to do this? Thanks

  • ITunes Server with D-Link DNS-323 NAS - not showing up in Shared list

    Hi I bought a DNS-323 to hold all my music. I am trying to get it working with iTunes. I have enabled the iTunes Server function on the DNS-323, selecting which folder I want to use for music, and have allowed the device to 'refresh'. It then tells m