LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

scroll bar on legend for xy graph

Is there a way to create a scroll bar for the legend of an XY graph?  The number of entries in the legend will be changing programmatically so the legend needs to be able to grow dynamically (which I have figured out how to do using property nodes).  Any ideas?

Cheers
0 Kudos
Message 1 of 22
(4,729 Views)

You can add your own scroll bar and handle the events, scroll value changed.  Maybe even a good use case for an X control since there could be several things to handle. 

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 2 of 22
(4,711 Views)
Im afraid that I dont follow.  I dont know what you mean when you say I can make my own scroll bar, and I have never worked with the active x end of things.
0 Kudos
Message 3 of 22
(4,707 Views)

No activeX needed (X controls was just a suggestion for a future code simplification but not required)  the scroll bar is a control in the numeric pallet.  You can handle the events to change the index of the legend shown.  Not too much work.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 4 of 22
(4,689 Views)
I certainly do appreciate your help!  I have a question for you, I have taken a look at a help file vi provided by ni "Cluster with Scrollbar.vi" and see how this works.  I am still unclear on how to enter the legend into a cluster so that I can have the scrollbar act upon it.  I have been looking at the property nodes for xy graphs thinking that I need to do something with a property node, any ideas?  Thank you again for the help!
0 Kudos
Message 5 of 22
(4,675 Views)

Sorry I might have misspoke.  Although you can create a scrollbar it would be difficult to scroll using the legend since you can not select the graphs to display in the ledgend (that is if you wanted to only show graphs 5-10 out of 20 for example)  it might be easier to creote an array of clusters and link the cluster to an active plot.  I have done this in the past for a similar situation.  The downfall is that you have to handle the properties of the graph in code.  What do toy wand to ultimatly do with the ledgend, there is probably a good workaround.

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 6 of 22
(4,658 Views)
Ultimately I will have 6 xy graphs in my vi, I would like to have a seperate scroll bar for the legend of each graph.  Each graphs legend will both grow and shrink as the program runs and I would like to use the scroll bar to keep the legend from growing off of the screen.  I would like to be able to dislpay the data from the point (6 m/s for example) along with its symbol on the xy graph (red dot for example) in the legend.  If I am umderstanding you correctly I need to bundle the type and color of the plot into a cluster with the data and then link that cluster to the scroll bar, I assume I can read the property node for each data point (setting it to active plot first) for both plot style and color?  Let me know if I am thinking about this correctly or if I have misinterpreted what you are saying.  Thank you very much for your help!

Cheers!
0 Kudos
Message 7 of 22
(4,655 Views)

That is exactly what I did, created a bundle called name, color(colorbox) and visible.  Created an array and used this instead of the default ledgend, I handled the change to the array and updated the properties in a loop usinf the index for active plot.  This array can be resized and a scroll bar is optional labview 8.0+.  The crappy thing is if you want access to all  options of the plot properties it gets a little  cumbersome.  A scrollbar would have been a nice feature for NI to have included.  Good luck,

 

Paul

Paul Falkenstein
Coleman Technologies Inc.
CLA, CPI, AIA-Vision
Labview 4.0- 2013, RT, Vision, FPGA
0 Kudos
Message 8 of 22
(4,647 Views)
Thank  you Paul, I think we are on the same page now.  I appreciate all of your help.  I do have another question for you.  How can I get the graphical representation for the color and style of the plot?  Right now I have a cluster with the plot name as a text string and the plot style as an unsigned 8 bit integer and the plot color as an unsigned 32 bit integer.  Is there an easy way to translate those into their graphical rep such as a red dot like it would appear on the xy graph?  Thanks again!

Cheers,
Jon
0 Kudos
Message 9 of 22
(4,643 Views)
Use the RGB to Color conversion VI. Indicators or controls of this type are "color boxes" that you can click on and change the color through the color palette.


Message Edited by Bill@NGC on 08-31-2007 10:08 PM

0 Kudos
Message 10 of 22
(4,623 Views)