I am trying to draw a class diagram where several relationships between two classes are defined with multiplicities.
By default, the results are horrible:
@startuml
class Movie {
genres: String[]
minutes: Integer
movie_id: String
rating: Float
title: String
type: String
votes: Integer
year: Integer
}
class Person {
birthYear: Integer
deathYear: Integer
name: String
person_id: String
}
Person "0..*" -> "1..*" Movie : acted_in
Person "0..*" -> "1..*" Movie : directed
Person "0..*" -> "1..*" Movie : produced
Person "0..*" -> "1..*" Movie : wrote
@enduml
With skinparam nodesep 200 it is a little better, but the multiplicities are still off:
I also tried with skinparam linetype ortho, which looked promising, but gets messed up as soon as I also add hide circle and hide methods…
Not to mention that eventually I would also like to add an association class, which really ruins it:
Here is the final code:
skinparam nodesep 200
skinparam linetype ortho
hide circle
hide methods
class Movie {
genres: String[]
minutes: Integer
movie_id: String
rating: Float
title: String
type: String
votes: Integer
year: Integer
}
class Person {
birthYear: Integer
deathYear: Integer
name: String
person_id: String
}
Person "0..*" -> "1..*" Movie : acted_in
Person "0..*" -> "1..*" Movie : directed
Person "0..*" -> "1..*" Movie : produced
Person "0..*" -> "1..*" Movie : wrote
(Person,Movie) .. Role
class Role {
name: String
}
@enduml
My question is: is there a way to draw this properly with PlantUML?



