【发布时间】:2013-10-14 03:51:57
【问题描述】:
我试图在节点标签下显示状态的属性。
目前是这样的:
________________________ ________________________
| | pause() | |
| |------------>| |
| | continue() | |
|________________________|<------------|________________________|
我有代码:
Graph = new Graph<State>();
var a = new State()
{
Status = "Ready",
AllowedPurchaserOperations = "operation1, operation2",
AllowedSupplierOperations = "operarion1, operation 3"
};
var b = new State()
{
Status = "Paused",
AllowedPurchaserOperations = "operation1, operation2",
AllowedSupplierOperations = "operarion1, operation 3"
};
Graph.AddVertex(a);
Graph.AddVertex(b);
Graph.AddEdge(new Edge<State>(a, b) {Label = "pause()"});
Graph.AddEdge(new Edge<State>(b, a) {Label = "continue()"});
我想或多或少地这样展示它:
________________________ ________________________
| Ready | pause() | Paused |
| operation1, operation2 |------------>| operation1, operation2 |
| operation1, operation3 | continue() | operation1, operation3 |
|________________________|<------------|________________________|
由于很难找到使用 graphviz 的实现示例,我不知道如何在节点中添加值。有人知道在转换之前我应该做什么吗?
【问题讨论】:
-
你在使用 QuickGraph 吗?
-
@marapet 我正在使用 graphviz4net
-
不幸的是,这个问题没有用 graphviz4net 标记,但迟到总比没有好。一篇关于在 WPF 中自定义图形元素的短文:graphviz4net.codeplex.com/…
-
@Steves 我无法添加标签,并且堆栈溢出时不存在 graphviz4net。我读过那个链接(我之前也读过)。谢谢。