Please provide a skinparam to center the text of the nodes in activity diagram

+3 votes
asked Jun 22, 2016 in Closed feature request by legz (300 points)

Please provide a skinparam to center the text of the nodes in activity diagram.

The goal is to obtain something like this :

Instead of this :

1 Answer

+4 votes
answered Jun 22, 2016 by plantuml (294,660 points)
selected Jun 22, 2016 by legz
 
Best answer

With last beta: https://dl.dropboxusercontent.com/u/13064071/plantuml.jar

You can now have:

@startuml
skinparam defaultTextAlignment center
start
:foo
very very very very long text;
end
@enduml

This has not been highly tested, so feedback is welcome.

commented Jun 22, 2016 by legz (300 points)
It seems to work like a charm on my diagrams, thanks!
commented Jul 4, 2016 by plantuml (294,660 points)
Note that this has been released in V8045
commented Jul 11, 2019 by rd27 (460 points)

This doesn't seem to work inside shape specific skinparams?

So this works:

skinparam defaultTextAlignment center

But this doesn't:

skinparam rectangle {
  defaultTextAlignment center
}

commented Nov 12, 2019 by anonymous

note for future generations:

My understanding from the documentation on skinparam name { ... } scoping is that:

skinparam rectangle { 

  defaultTextAlignment center

}

Is the same as saying:

skinparam rectangledefaultTextAlignment center

...