Improved legend support

0 votes
asked Dec 13, 2018 in Wanted features by dlidstrom (150 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 (198,300 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 (150 points)
That's perfect, thanks for the tip! I'm happy with the limitation, no problem.
commented Jan 30 by dlidstrom (150 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 by plantuml (198,300 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 by dlidstrom (150 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 by plantuml (198,300 points)
Forget to mention that the beta is hosted here http://beta.plantuml.net/plantuml.jar
commented Feb 5 by dlidstrom (150 points)
From my initial tests this seems to work fine.
Thanks!
commented Mar 14 by nicamlg (200 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 by plantuml (198,300 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!
...