Text alignment of single label

+1 vote
asked Feb 27 in Question / help by KEM (140 points)

Is it possible to use "skinparam defaultTextAlignment center" but overrule the setting for a single label in an activity diagram. So all labels are aligned center, except for 1 label that is aligned to the left?

2 Answers

+1 vote
answered Feb 27 by dickmaley (4,160 points)
selected Feb 28 by KEM
 
Best answer

image

@startuml
<style>
activityDiagram {
  DiagonalCorner: 0;
  FontName: SansSerif;
  FontSize:: 14;
  FontStyle plain
  HorizontalAlignment left
  LineColor black
  LineThickness: 2.0;
  RoundCorner: 25);
  activity {
    BackgroundColor #white/palegreen
    FontColor black
    FontStyle Bold
    LineColor black
    'Shadowing: 3.0;
    HorizontalAlignment: left;
  }
  .different {
    BackgroundColor #white/palegreen
    FontColor black
    FontStyle Bold
    LineColor black
    'Shadowing: 3.0;
    HorizontalAlignment: center;
  }  
}
</style>
title Activity Diagram 
start
 :start;
 
  partition "My Partition" {
   :foo1
   hhhhhhhhhhhhhhhhhh
   ggggggggg;
   :foo2;
  }
 
   :foo3;
   note right: Note
   detach
 
 if (foo4) then (yes)
   :foo5
   mmmmmmmmmmmmmmmmm
   ggggggggggg;
   detach
 else (no)
  stop
 endif
 :foo6
 tttttttttt
 hhhhhh;
 detach
 :foo7
 cccccccccccccccccccc
 kkkkk;<<different>>
 stop
@enduml

All aligned left except for one.

0 votes
answered Feb 27 by dickmaley (4,160 points)
Please provide your code
...