Welcome to yEd Q&A!
Here you can ask questions and receive answers from other members of the community and yEd developers. And you can tell us your most wanted feature requests.

Categories

How to Make Edge Label Background Transparent?

0 votes
When I position edge labels on top of an edge, I make the background white so that the label is readable. However, when I export that graph as an SVG and select transparent background, the labels still have a white background box, not a transparent box. That's unsightly if I display that SVG over top of a non-white background and even if I put it on a white background there are faint edges around the background box when I print it. Is there a way to make the label backgrounds transparent?
in Help by (120 points)

2 Answers

0 votes
The "Transparent Background" option in the SVG Export settings refers to the diagram background not to the background of labels. E.g. change option "Color" on tab "Background" in "File" -> "Preferences" from "#ffffff" (white) to "#ff0000 (red) and export your diagram once with "Transparent Background" enabled and once with "Transparent Background" disabled to see the effects of this property.

If you want to export all labels with transparent backgrounds, you need to change your labels' "Background" property to "No Color". You can do so for all edge labels at once (select one edge label, use CTRL+A to select all edge labels, then change the "Background property in yEd's properties view).
by [yWorks] (160k points)
Thanks, but if I set it to No Color then the edge obscures the label.

But you explicitly asked for transparent background:

"Is there a way to make the label backgrounds transparent?"

If you think that it might be possible to give a label an opaque background whose background color is the background color of the HTML page in which the SVG is displayed, then the answer is "no, this is not possibe". yEd cannot know which background color you are using in your HTML pages. However, you know which background color you are using in your HTML pages, so use the approach described above to set the label background color to the background color of your HTML page.

The only alternative I can think of is adding JavaScript code to your HTML page which changes the label background color in the displayed SVG document on-the-fly.

0 votes

Usual color values are #RRGGBB, where RR is the hex representation of the value of the red channel, GG is of the green channel and BB is of the blue channel. It appears1 that yEd also supports the #RRGGBBAA where AA is of the alpha channel value. 00 - completely transparent. FF - completely opaque. You can set any value in between to reach the preferred transparency level.

For example #C2A43380 will give a translucent mustard yellow.
 


1 - Tested on version 3.21.1 for Ubuntu 20.04.

by
Legal Disclosure | Privacy Policy
...