为什么在 Graphviz 中 fillcolor 无法工作?

85

我按照Graphviz文档中的确切指示操作,但无法为节点添加填充颜色。

这是我的图形:

digraph hello_world {
 node [href="javascript:void(click_node('\N'))"]
 node0 [label="No label",shape=box,width=0.75,height=0.75,fixedsize=true]
 node1 [label="No label",shape=box,width=0.75,height=0.75,fixedsize=true]
 node2 [label="No label",shape=box,width=0.75,height=0.75,fixedsize=true]
 node3 [label="No label",shape=box,width=0.75,height=0.75,fixedsize=true]
 nodeEdge0 [fixedsize=true,shape=diamond,label=".Nojjjj label.",fillcolor=red]
 node3 -> nodeEdge0 [arrowhead=none]
 nodeEdge0 -> node2
}

然而,该图表并没有将nodeEdge0设置为红色背景颜色。

有任何想法吗?

1个回答

149

在节点中添加style=filled属性

nodeEdge0 [fixedsize=true,shape=diamond,label=".Nojjjj label.",fillcolor=red, style=filled]

4
如果已经有了 fillcolor,那为什么还需要 style=filled - Ooker
1
“因为文档是这么说的”。(https://graphviz.org/docs/attrs/fillcolor/)。但是,我也希望有一个不同的默认值。 - Markus Weninger

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接