Wednesday, 10 May 2023

PlantUML: change use case diagram direction left to right

Use case diagram direction is top to bottom by default, we can customize this to ‘left to right’ with below statement.

 

Syntax

left to right direction

topToBottom.txt

@startuml

' This is the default behavior
top to bottom direction

actor user1

usecase "use case 1" as UC1
usecase "use case 2" as UC2
usecase "use case 3" as UC3
usecase "use case 4" as UC4

user1 --> (UC1)
user1 --> (UC2)
user1 --> (UC3)
user1 --> (UC4)

@enduml

Above snippet generates below diagram.




leftToRight.txt

@startuml

left to right direction

actor user1

usecase "use case 1" as UC1
usecase "use case 2" as UC2
usecase "use case 3" as UC3
usecase "use case 4" as UC4

user1 --> (UC1)
user1 --> (UC2)
user1 --> (UC3)
user1 --> (UC4)

@enduml

Above snippet generate below diagram.

 


 

 

 

Previous                                                    Next                                                    Home

No comments:

Post a Comment