LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Customize chart legend relative position of text and icon

Is there a way to customize the relative position of the text and the icon in a chart legend? I have a horizontal legend with two plots, and the icon of the first plot sits closer to the text of the second plot, and users find it confusing. Here's a screenshot of what I mean:

 

abvenk_0-1702319508597.png

 

The text of "Upstream flow" is spaced out more from its own icon, which is closer to the text of "Downstream flow", whose icon is again spaced out to the far right. It looks as though the blue plot icon belongs to "Downstream flow".

 

Is there a way to move the icons closer to their respective texts and add more separation between the two sets of text and icon? Or, is there a way to move the icon to the left of its respective text so that with the text being left-aligned, the icon and its text are grouped closer together? 

 

Thanks!

0 Kudos
Message 1 of 9
(940 Views)

I guess right-aligning the text in the legend is one way:

 

abvenk_0-1702320028170.png

 

But this seems hacky and awkward. Left-aligned items look better in the legend, but I cannot seem to find a property to change the relative position of the text and icon. Like, if I could move the icon to the left of the text, that would be perfect.

0 Kudos
Message 2 of 9
(938 Views)

Using the property Legend Size you can change it, but strangely, only if they are stacked vertically 

LVNinja_0-1702321128576.png

 

0 Kudos
Message 3 of 9
(932 Views)

@abvenk wrote:

Is there a way to customize the relative position of the text and the icon in a chart legend?


Right click the graph and select Advanced>>Customize.

 

It looks like in this dialog you can select the text and move it even without switching to the Customize mode (by clicking the wrench button). After you finish, close the window and apply your changes.

 

I haven't played with it too much, but if your plot names are relatively fixed, it looks like you can get what you want.


___________________
Try to take over the world!
0 Kudos
Message 4 of 9
(877 Views)

I tried this, but I can't move the text or the icon. It looks as though they are moveable but nothing happens, they just snap right back into their original place.

0 Kudos
Message 5 of 9
(853 Views)

The legend is an array of clusters.  Each cluster containing 3 elements:

  • A string (the name of the plot).
  • A boolean checkbox, usually hidden, to the left of the string.
  • A boolean that is the plot icon, to the right of the string.

The autosizing of the cluster is set to 1 (Size to Fit).

0 Kudos
Message 6 of 9
(849 Views)

Here is a Waveform Graph control that I hacked into to move the plot icon to the left of the plot name.

0 Kudos
Message 7 of 9
(845 Views)

@paul_a_cardinale wrote:

Here is a Waveform Graph control that I hacked into to move the plot icon to the left of the plot name.


You actually don't need to hack.  You can move it using the built-in customizing tool.

0 Kudos
Message 8 of 9
(844 Views)

@abvenk wrote:

I tried this, but I can't move the text or the icon. It looks as though they are moveable but nothing happens, they just snap right back into their original place.


If by "this" you are referring to my suggestion, then I can say it definitely works here (for example on LV 2015, which I currently have open) and apparently works for Paul as well. In the customize window I can grab and move any of the three elements using the mouse or the keyboard and they stay where I put them. With the auto-tool, it does require either holding down Shift to switch to the selection tool or standing on the correct pixel before clicking.

 

See attached example.


___________________
Try to take over the world!
0 Kudos
Message 9 of 9
(804 Views)