How to change box border thickness and border style in sequence diagram

0 votes
asked 4 days ago in Question / help by May
I want to change the border thickness and style of a "box" in a sequence diagram.
Therefore, I set it as follows.
skinparam sequence {
    BoxBorderColor #Black
    BoxBorderThickness 10
    BoxBorderStyle dashed
}

However, there was no change in the box border.

How I can change a "box" border thickness and Style?

2 Answers

0 votes
answered 4 days ago by The-Lu (70,400 points)
 
Best answer

Hi M.,

Here is a proposal, (but it seems global) using style as:

@startuml
<style>
box {
  LineColor #blue
  LineThickness 5
  LineStyle 15-5
}
</style>

box "Foo1"
participant Alice1
participant Alice2
end box

box "Foo2"
participant Bob1
participant Bob2
end box
Alice1 -> Bob1 : hello
Alice1 -> Out : out
@enduml

Enjoy,
Regards,
Th.

commented 4 days ago by May
Dear The-Lu,

Thank you for your swift and accurate response.
I'm able to achieve what I want to do!
This setting is also effective with ‘!pragma teoz true'.

Best regards,
May
0 votes
answered 3 days ago by kirchsth (6,660 points)

If you want you could define stereotype specific styles too (base idea is used in C4-PlantUML too).

BR Helmut

@startuml
!pragma teoz true

<style>
box {
  LineColor #blue
  LineThickness 5
  LineStyle 15-5

  .system_boundary {
    LineColor #6b254b
    LineThickness 3
    LineStyle 5-5
    FontColor #6b254b
    BackgroundColor transparent
    BorderColor #6b254b
  }
}
</style>

skinparam sequencebox<<container_boundary>> {
    FontColor #d7a538
    BackgroundColor transparent
    BorderColor #d7a538
    BorderStyle dashed
}

participant c1 

box "API Application\n<size:12>[Container]</size>" <<container_boundary>><<boundary>>
  
participant c2 
box "API Application\n<size:12>[System]</size>" <<system_boundary>><<boundary>>
participant c3 
end box
  
participant c4 
end box

c1 -> c2 : call
c2 -> c3 : call
c3 -> c4 : call

hide stereotype
@enduml

commented 2 days ago by May
Dear kirchsth,

Thank you for your great answer.

This is what I was looking for.
I tried,it seems that specifying BorderStyle with skinparam is ineffective.

(Box "container_boundary" border style is solid line.)

Best regards,
May

@startuml
!pragma teoz true

<style>
box {
  LineColor transparent
  LineThickness 5
  BackgroundColor #APPLICATION

  .system_boundary {
    LineColor #6b254b
    LineThickness 3
    LineStyle 5-5
    FontColor #6b254b
    BackgroundColor transparent
    BorderColor #6b254b
  }
}
</style>

skinparam sequencebox<<container_boundary>> {
    FontColor #d7a538
    BackgroundColor transparent
    BorderColor #d7a538
    BorderStyle dashed
}

box "Board"
participant c1

box "API Application\n<size:12>[Container]</size>" <<container_boundary>><<boundary>>
  
participant c2
box "API Application\n<size:12>[System]</size>" <<system_boundary>><<boundary>>
participant c3
end box
  
participant c4
end box

c1 -> c2 : call
c2 -> c3 : call
c3 -> c4 : call
end box

hide stereotype
@enduml
...