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.


1 Answer

0 votes
answered Dec 13, 2018 by plantuml (257,860 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 pages.

So you can have

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 (257,860 points)
No need for GitHub issue : we use this forum as a request manager.
So with last beta, you can have:

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

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

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


Note that only little testing has been done, so feedback is welcome!
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 but it doesn't seem to work. Presumably that is not the beta version. Is it available somewhere?
commented Jan 31, 2019 by plantuml (257,860 points)
Forget to mention that the beta is hosted here
commented Feb 5, 2019 by dlidstrom (240 points)
From my initial tests this seems to work fine.
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 (257,860 points)
Thanks for the feedback. This one is on our side.
It has just been fixed in last beta
Tell us if you find other issues!