How can I draw a sample line with a style within a table cell?

0 votes
asked Nov 11, 2022 in Question / help by boshka (3,940 points)
edited Nov 11, 2022 by boshka
I'd like to have a legend (or a note) with a table, describing all the styled lines in a diagram.

so, I'd want something like:

@startuml

!$style1 = "#red,dashed"

!$style2 = "#blue,dotted"

...

legend

| Line Style | Description |

| -[$style1]-> | Scenario 1 |

| -[$style2]-> | Scenario 2 |

endlegend

@enduml

the Line Style column should have to display visually the lines with their styles applied.

So, I'd like to see it something like this (this snippet is just a visualization, demoing what I'd like to achieve within the cells):

http://www.plantuml.com/plantuml/umla/POynRuCm48Nt-nKNcW4aCa2tHaaJjMEtZ5K6OryQgyP6jb4LXVptseGKK6zWUE-3xx5pdbdVrWhSjzGDiwn6RfInUslDpu5YugNHXuPnmcTOB9s_A2fmWycJ9P4BviuaaaTHzaMbMig5yJusq2jWzJcykXx8useByfI-6IrUCtycdLx8PICN-vSzZtOirlESbADKcv4kftIvdkUaXJp1VC6a0rWqrd0IhILSSYCelGCknwKWnsq6roiWec8LAKmw39SWSyWcwHtjumfYpl1XTCTjo6utM0JTdmiG57t50Hr-I4ruY2ns-1u_99luBx091zDHHHu7Y1718ibW5Mw6bV-mCc11DYXtuT7MwXS0

Note, that I do have to use the $style1 and $style2 within the legend (cannot put just <color:#red>--></color>, etc., for example) since the styles come from an external configuration.

Is there a way to achieve this?
commented Nov 14, 2022 by The-Lu (64,760 points)

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
Anti-spam verification:

[Antispam2 Feature: please please wait 1 or 2 minutes (this message will disappear) before pressing the button otherwise it will fail](--------)
To avoid this verification in future, please log in or register.
...