nidi3 / graphviz-java

Use graphviz with pure java
Apache License 2.0
937 stars 107 forks source link

How to set rankdir with LR? #201

Open essayZW opened 3 years ago

essayZW commented 3 years ago
MutableGraph containerGraph = Factory.mutGraph ()
    .setDirected ( true )
    .graphAttrs ().add ( RankDir.LEFT_TO_RIGHT );

Then i get an error.

Cannot resolve method 'add(guru.nidi.graphviz.attribute.Rank.RankDir)'

What should I do

frademacher commented 3 years ago

Hi @essayZW,

For me, the following works:

g.graphAttrs.add("rankdir", "LR")
essayZW commented 3 years ago

Hi @frademacher Thanks for your help, I solved this problem.