Text rotated parallel to arrow

+1 vote
asked May 19, 2022 in Question / help by anonymous

Is it possible to have the text of an arrow parallel to the arrow and ontop of it?

In particular, I'd like to make an use-case diagram with extend/include arrows looking like this:

Use-case diagram with the wanted arrows

As you can see, the <<extend>> and <<include>> are part of the arrow.

If I try to recreate the same in PlantUML, it looks like this:

Use-case diagram from PlantUML

@startuml

usecase "UseCase" as a

usecase "UseCase" as b

usecase "UseCase" as c

a -[hidden]r-> c

a .d.> b : <<extend>>

b <.u. c : <<include>>

@enduml

Is there a way to achieve the wanted look in PlantUML?

Thank you for your help.

2 Answers

0 votes
answered Nov 19, 2024 by Mike

Maybe this will help

@startuml
left to right direction

usecase "UseCase1" as a

usecase "UseCase2" as b

usecase "UseCase3" as c


a ..> b : <<extend>>

b <.down. c : <<include>>

a -[hidden]-> c

@enduml

0 votes
answered Nov 20, 2024 by The-Lu (77,040 points)

Hi A.,

Here is another workaround, using LaTeX, as:

@startuml
usecase "UseCase1" as a
usecase "UseCase2" as b
usecase "UseCase3" as c
a ..> b : <latex>\rotatebox{-75}{<<extend>>}</latex>
c ..> b : <latex>\rotatebox{75}{<<include>>}</latex>
@enduml

Ref.:

Enjoy,
Th.

...