Thursday 7 September 2023

How to Customize line thickness in PlantUML class diagram?

Class1 -[thickness=1]-> Class3

 

Above snippet set the line thickness to 1 pixel.

 

lineThickness.txt

@startuml

class Class1
class Class2

Class1 --> Class2
Class1 -[thickness=1]-> Class3
Class1 -[thickness=2]-> Class4
Class1 -[thickness=4]-> Class5
Class1 -[thickness=8]-> Class6
Class1 -[thickness=16]-> Class7

@enduml

  Above snippet generate below diagram.

 


We can use line style, color and thickness all together.

Class1 -[#red,bold,thickness=1]-> Class3

lineStyleColorThickness.txt

@startuml

class Class1
class Class2

Class1 --> Class2
Class1 -[#red,bold,thickness=1]-> Class3
Class1 -[#blue,dashed,thickness=2]-> Class4
Class1 -[#green,dotted,thickness=4]-> Class5 
Class1 -[#0000ff,hidden,thickness=8]-> Class6
Class1 -[#gold,plain,thickness=16]-> Class7

@enduml

Above snippet generate below diagram.


  


Previous                                                    Next                                                    Home

No comments:

Post a Comment