Is it possible to only use straight lines in a class diagram?

+16 votes
asked Feb 12, 2014 in Wanted features by (120 points)

At the moment, it seems to me that it's impossible to only use orthogonal lines in a class diagram (already tried the option of using 'skinparam linetype ortho' but the result remains the same).  Is it possible to integrate such a drawing hint in PlantUML?

Thanks in advance!
commented Jan 21, 2016 by vikingil (100 points)
Strongly agree!
PlantUML is very useful to visualize the classes interaction when you need to make changes in a large unknown code base with many classes.
Following the curved lines in the class diagram is very difficult when there are many of them, especially as you don't have control on the classes positions.
It will help a-lot if you will implement this feature.
commented Feb 1, 2016 by anonymous
I Just used this feature.
ortho looks very good, much more clearer.
I have 2 improvements suggestions though:
1. When possible increase the distance between 2 parallel arrows to   make things clearer, either automatically or by a setting.
2. Consider doing what visio is doing when 2 lines intersect e.g. adding
a small bump in one of the lines that looks like the Greek letter omega.

2 Answers

+1 vote
answered Oct 30, 2015 by swilhelm (140 points)

This feature interest me too.
+4 votes
answered Jan 22, 2016 by plantuml (294,660 points)

Ok, with last beta version:

You can have:

 skinparam linetype polyline


 skinparam linetype ortho

This has been not very well tested, so do not hesitate to post here if you find issues!

commented Feb 1, 2016 by anonymous
Thanks, most appreciated.
commented Feb 29, 2016 by anonymous
When 2 lines intersect you might want to consider adding
a small bump in one of the lines (something like the Greek letter omega).
commented Mar 4, 2016 by anonymous
polyline works fine, but with the ortho line style, line labels are positioned far away from their line; for example, in:

skinparam linetype ortho
node "Test PC" as PC {
    component Terminal
    component COM1
    Terminal ..o COM1
node Adapter
node DUT
PC -- Adapter : USB
Adapter -- DUT : UART
Terminal <~~> DUT
commented Oct 3, 2016 by anonymous
The line label positioning issue when linestyle "ortho" is enabled still occurs with PlantUML v8048.

When adding '!pragma svek_trace', converting the `` file with GraphViz yields the following error:

Warning: Orthogonal edges do not currently handle edge labels. Try using xlabels.

and the label seems to be misplaced, just like in the PlantUML output.

Changing 'label=' to 'xlabel=' in the Dot file seems to fix this (for GraphViz) at least.

Maybe PlantUML could also generate 'xlabel=' instead of 'label=', possibly only when orthogonal linetype is in effect ?
commented Oct 4, 2016 by anonymous
+1 for implementing this solution for positioning labels better with ortho line style.
commented Nov 21, 2017 by Pangamma (120 points)
Thank you! very helpful.
commented Apr 2, 2019 by larrie (100 points)
Can you fix the label isse from
with 'label=' to 'xlabel=' in the Dot file (for GraphViz)?
commented Jul 31, 2021 by plantuml (294,660 points)

Sorry for the delay...

Here is a new beta that does output forcelabels=true and use xlabel when skinparam linetype ortho is set.

Tell us if results are better!