LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Add fields to plot legend of XY graph

Solved!
Go to solution

I am looking to create a custom plot legend for an XY graph that contains from left-to-right:

 

(1) plot visibility

(2) plot name

(3) scale index

(4) mapping

(5) scale max

(6) scale min

(7) 1 or more plot attributes (e.g., color, point style, interpolation)

(8) statistics of plot data (e.g. mean, std or slope, intercept)

 

It seems like that plot legend functionality and contents are part of an xcontrol, I'd prefer not to go down that road.  My preference is to create an array of clusters and simply hide the plot legend and then use value-change events to programmatically change the plot attributes with property nodes. I've done this before with a pict ring and clunky glyphs, but I am seeking a cleaner look.

 

Does anyone know where I might be able to get the glyphs that appear in the run-time menu choices to make these pict rings? Or better yet, has someone made such custom controls? 

 

Thanks,

Jeremy

 

 

 

 

 

Download All
0 Kudos
Message 1 of 7
(1,729 Views)

The idea with an array of clusters seems fine. You can copy/paste the regular glyphs easily.

 

You could also use a multicolumn listbox where you show the symbol as checked/not checked and the color field by an empty cell with defined background color.

 

Do you want the user to be able to change colors?

 

 

0 Kudos
Message 2 of 7
(1,702 Views)

Also note that LabVIEW NXG has a "Data Grid" where you can implement the cluster idea, just much more cleanly. This is missing in classic LabVIEW but you can get close by using flat parts.

 

 

0 Kudos
Message 3 of 7
(1,695 Views)

Thanks, Altenbach.

 

I have yet to make the jump to NXG. I see that the cRIO and FPGA has been added in the last year or so. It gets more tempting every day. 

 

Do you know where the point style glyphs are stored? I can't seem to find them in the LabVIEW Data\Glyphs directory. 

 

Jeremy

0 Kudos
Message 4 of 7
(1,687 Views)
Solution
Accepted by topic author JHourigan

You could just cut&paste from the properties page using MS Paint :D.

 

altenbach_0-1596650782285.png

 

Message 5 of 7
(1,678 Views)

Nice workaround.  

 

Incidentally, it looks like there are a couple of packages that implement the data grid in classic LabVIEW. They work with .NET; however, for this application, I want to maintain platform independence.  So I guess I will just stick with Altenbach's workaround.

 

Okay, attached are the results of some punishingly boring cutting and importing and the array of clusters that results. Perhaps these will be starting points for folks doing this sort of customization. 

 

Thanks again Altenbach!

Message 6 of 7
(1,650 Views)

Here's a youtube video of the custom legend solution. The user events regarding scaling changes need a bit of refinement.  I have yet to include mean and standard deviation into this. But you'll get the gist. There is a somewhat complex subVI (attached below) that filters and acts upon these plot legend events.  You'll need to download the custom controls in another reply in this thread for the attached VI to work.

 

https://youtu.be/70651bUxx6s

 

 

0 Kudos
Message 7 of 7
(1,579 Views)