1

I've followed the solution proposed here successfully, but when trying to export the legend to SVG, the only thin visible is the last encoded color. Am I missing a closing instruction to avoid this?

Here you have a simplified example, try to export it to SVG and you will have a black square as a result. Export as PNG works fine.

@startuml

legend   
|= |= Colours | 
|<back:#F59175>   </back>| Pink | 
|<back:#FEFECE>   </back>| Yellow |
|<back:#000000>   </back>| Black | 

endlegend

@enduml 

Solution to the problem (thanks to the comment of GeekBoy ):

@startuml

legend   
|=   |= Colours | 
|<#F59175>| Pink | 
|<#FEFECE>| Yellow |
|<#000000>| Black | 

endlegend

@enduml 

NB. dimension of the first column is defined by the first cell |= |.

  • The problem is with the spaces in between the back tags. I had a similar issue with generating latex files. I just used \phantom to fill in dummy characters and applied the style manually. – Kaarthik Feb 28 '18 at 01:52
  • 1
    Thanks for the input. I've tried to find how to implement a \phantom solution for plantuml and reviewing the documentation about creole, I've found a solution to my problem. tag has to be avoided if blank, just add as many blanks as you need to dimension the column on the first row of the table, and use a color tag in each cell of the first column. Now export to SVG is fine. See edited question. – jean pierre huart Feb 28 '18 at 11:55

1 Answers1

0

The solution you posted above did not work for me (the color backgrounds only appear for yellow, and there was not much space in the cell). Here's the solution I found based on your original question:

@startuml

legend
|= |= Colours |
|<back:#F59175>   </back>| Pink |
|<back:#FEFECE>   </back>| Yellow |
|<back:#000000>   </back>| Black |
endlegend

@enduml 

enter image description here

Here's the SVG version:

SVG version

Fuhrmanator
  • 11,459
  • 6
  • 62
  • 111