Mas*_*Man 10 documentation-generation plantuml
我想基于某个标准在我的类图中为类着色,然后显示一个看起来大致如下的图例:

如果我能内PlantUML的添加HTML表格legend和endlegend,我可以通过更改单元格背景实现这一目标.但是,添加HTML <table>不起作用.我也尝试使用PlantUMLsalt来插入表格,但我找不到任何方法来为表格的单元格着色.
有没有办法实现这个目标?
nfe*_*fec 10
这不是完美的,但你可以使用克里奥尔表.(见 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
Run Code Online (Sandbox Code Playgroud)

有一些绘图工件,但它是你期待的吗?
来自plantuml论坛.他们允许在这里复制这个答案.
是的,请将我们的答案复制/粘贴到StackOverflow:它确实很有帮助
http://plantuml.sourceforge.net/qa/?qa=3596/how-to-generate-a-legend-with-colors-in-plantuml
Ama*_*den 10
我尝试了nfec的解决方案,但该解决方案对我不起作用,但它使我开始尝试了一种可行的解决方案。这就是我得到的。
legend right
|Color| Type |
|<#FF0000>| Type A class|
|<#00FF00>| Type B class|
|<#0000FF>| Type C class|
endlegend
Run Code Online (Sandbox Code Playgroud)
以其他答案为基础,获取样式符合原始请求的图例:
' set legend to have a white background
skinparam legendBackgroundColor #FFFFFF
' remove box around legend
skinparam legendBorderColor #FFFFFF
' remove the lines between the legend items
skinparam legendEntrySeparator #FFFFFF
legend right
' the <#FFFFFF,#FFFFFF> sets the background color of the legend to white
<#FFFFFF,#FFFFFF>|<#red>| Type A Classes|
' the space between the | and <#blue> is important to make the color column wider
|<#blue> | Type B Classes|
|<#green>| Type C Classes|
endlegend
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
3825 次 |
| 最近记录: |