Improved legend support

0 votes
asked Dec 13, 2018 in Wanted features by dlidstrom (240 points)
It would be useful to be able to specify legend location. For example, {top,bottom} {left,right} (all combinations). Also, it would be useful if packages were able to have legend.

Thanks!

1 Answer

0 votes
answered Dec 13, 2018 by plantuml (294,960 points)
selected Dec 14, 2018 by dlidstrom
 
Best answer
About legend for package, it's a good idea. However we are facing a GraphViz limitation here : we won't be able to put legend on the bottom of a package, only at the top. So we are not going to implement it, unless this limitation is ok for you.

About legend location, it's already possible, but not documented until now. We've just updated http://plantuml.com/commons pages.

So you can have http://www.plantuml.com/plantuml/uml/SoWkIImgAStDuNBCoKnELT2rKt3AJrAmKl18pSd9vyf9JK_DIr4eoIzGo4bDA-5IK0ZEo2y2qH0PBY26iXo01D0S0000

Is this what you were looking for ?
commented Dec 14, 2018 by dlidstrom (240 points)
That's perfect, thanks for the tip! I'm happy with the limitation, no problem.
commented Jan 30, 2019 by dlidstrom (240 points)
Is there a GitHub issue for the request to have package legend? I'm ok with having it on top only.
commented Jan 30, 2019 by plantuml (294,960 points)
No need for GitHub issue : we use this forum as a request manager.
So with last beta, you can have:

@startuml
class foo1
package pack1 <<st>> {
legend
  This is the legend for the package1
  on several lines
end legend
class foo2
}

package pack2 {
legend
   This is the legend for the package2
end legend
class foo3
}

legend
  This is the legend for the diagram
  on several lines
end legend

@enduml

Note that only little testing has been done, so feedback is welcome!
Thanks!
commented Jan 31, 2019 by dlidstrom (240 points)
So I am having trouble finding the beta version. I've tried having a package legend using http://sourceforge.net/projects/plantuml/files/plantuml.1.2019.0.jar/download but it doesn't seem to work. Presumably that is not the beta version. Is it available somewhere?
Thanks!
commented Jan 31, 2019 by plantuml (294,960 points)
Forget to mention that the beta is hosted here http://beta.plantuml.net/plantuml.jar
commented Feb 5, 2019 by dlidstrom (240 points)
From my initial tests this seems to work fine.
Thanks!
commented Mar 14, 2019 by nicamlg (140 points)
I don't know if it is possible to solve, since you've said GarphViz has some limitations, but if the package is not <<frame>> (say <<rectangle>>) the legend appears BEFORE the package name/title.
commented Mar 14, 2019 by plantuml (294,960 points)
Thanks for the feedback. This one is on our side.
It has just been fixed in last beta http://beta.plantuml.net/plantuml.jar
Tell us if you find other issues!
...