我想根据某个标准为我的类图中的类着色,然后显示一个图例,大致如下所示:
如果我可以在 PlantUML 的 legend
中添加一个 HTML 表格和 endlegend
,我可以通过更改单元格背景来实现这一点。但是,添加 HTML <table>
不起作用。我也尝试使用 PlantUML's salt
插入表格,但我找不到任何方法来为表格的单元格着色。
有没有办法实现这一目标?
最佳答案
这并不完美,但您可以使用克里奥尔语表。 (看
http://plantuml.sourceforge.net/creole.html )
@startuml class foo
legend
|= |= Type |
|<back:#FF0000> </back>| Type A class |
|<back:#00FF00> </back>| Type B class |
|<back:blue> </back>| Type C class |
endlegend
@enduml
![Image showing the legend.](/image/chP0m.png)
有一些绘图工件,但这是您所期望的吗?
来自 Plantuml 论坛。他们允许在这里复制这个答案。
Yes, please copy/paste our answer to StackOverflow : it would indeed by helpful
http://plantuml.sourceforge.net/qa/?qa=3596/how-to-generate-a-legend-with-colors-in-plantuml
关于documentation-generation - 如何在PlantUML中生成带有颜色的图例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/30999290/