LabVIEW Idea Exchange

cancel
Showing results for 
Search instead for 
Did you mean: 
Enrico_Segre

label array elements with their index (visibile item option)

Status: New

I find often the need of creating array indicators with many elements, and of labelling them is a way which allows easy identification of the element index.

Normally the labels of the elements can be made visible, like in the left example shown:

 

array index labelling example

 

One way of doing it, if the array has a fixed size, and all of the array is shown at once, is to juxtapose a set of text labels identifying the elements. Tedious to build.

 

If the array changes size, if it is larger than shown, if it is supposed to be scrolled on the FP, static labels are useless. Currently the label of the element can be made visible, but all elements share the same label. The index display of the array can be shown, but it relates to a single element, which makes cumbersome to identify elements of long arrays.

 

I usually resort to more sophisticate contraptions, like arrays of clusters, each composed of the element in question and of a numeric indicator; or to two parallel array indicators, one for the elements itself and one for the indices. Both solutions are more cumbersome to build and to size and align equally; the index content has to be prefilled and maintained in sync when array elements are added or deleted (programmatically or via contextual menu); in the second case, a lot of events have to be trapped programmatically, for instance to maintain synchronism when the main array is scrolled.

 

What I would like to have is an additional label natively visible, showing the element index, like on the right.

The labels could be made optionally visible with a contextual menu ---- left click->visible items->index label.

Options (perhaps properties) in order to set the value of the first element (e.g. 0 or 1 or any other value) and the step value if different than 1 would also be useful. Standard options about location and orientation of the label with respect to the array element would apply.

3 Comments
tst
Knight of NI Knight of NI
Knight of NI

And while NI is at it, maybe adding another option of a temporary index label which will basically float over the existing control and simply use a contrasting color for its font.

 

This could be useful if you work on the array and you want to see the index, but you don't want to change the size of the control.


___________________
Try to take over the world!
Enrico_Segre
Active Participant

Now that I think at it, the possibility of specifying in some property the display format for the index label would be great -- like "Channel %d" etc. instead of a default "%d".

All the font styling and coloring options to the index label should also be applicable.

Broken_Arrow
Active Participant

This is a step in the right direction. To many times we are forced to use clusters just for ease of labeling.

Richard