首页 > 解决方案 > 有没有办法将箭头作为表格项目?

问题描述

为了将图例定位在图表的右下角,有人建议我使用这个labelloc="b" labeljust="r"技巧。仅当所有图例都可以作为标签中的表格移植时,这是可行的,这是另一个技巧。但是,我的图例中要解释的项目是边,而不是节点,所以我的图例需要包含两个表。

这是我现在的传说:

digraph {    
    subgraph clusterLegend { 
    rank = sink;
    label = "Legend";
    fontsize = 20
    node [ color="white" ]
    {rank=same; key, key2}
    key [ label=<<table border="0" cellpadding="2" cellspacing="0" cellborder="0">
      <tr><td align="right" port="i1">A</td></tr>
      <tr><td align="right" port="i2">A</td></tr>
      </table>> ]
    key2 [ label=<<table border="0" cellpadding="2" cellspacing="0" cellborder="0">
      <tr><td align="left" port="i1">B     The reason for A is B</td></tr>
      <tr><td align="left" port="i2">B     The solution for A is B</td></tr>
      </table>>]
    key:i1 -> key2:i1 
    key:i2 -> key2:i2 [ arrowhead="odiamond" style=dashed ]
   }
}

如果有办法将箭头作为表格项,那么我只需要一个表格,因此这个技巧会奏效。那么有没有办法做到这一点?

标签: html-tablelegendgraphvizarrows

解决方案


推荐阅读