Gantt Style Selector for specific task/class to color tasks by tag?

0 votes
asked Feb 6 in Question / help by MDG

Is it possible to define a style like:

critical {
   lineColor Red
}

dev {
  FontColor DarkGray
  BackGroundColor Gray
}

prod {
  FontColor White
  BackGroundColor DarkGreen
}

I'd like to define some styles and then tag a task to apply the appropriate style. I've seen some folks accomplish this by adding a style right before a task and then applying the base style right after, but I'm looking for a better solution that allows me to format the task with the defined style as I'm writing it.

Something like:

@startgantt
!$now = %now()
!$today= %date("YYYY-MM-dd", $now)

Project starts $today
today is colored in red
[foo] lasts 10 days #critical
then [Task2] lasts 14 days

@endgantt

Is something like that possible? I tried figuring out whether there were skinparam features that would do this, but I couldn't find anything.

1 Answer

0 votes
answered Feb 6 by The-Lu (67,080 points)

Hello M, and all,

Awaiting full style management with stereotype on Gantt char...

See similar request here:

Here is a workaround using style locally, as:

@startgantt
!$now = %now()
!$today= %date("YYYY-MM-dd", $now)

Project starts $today
today is colored in red
<style>
task {
  lineColor red
}
</style>
[foo] lasts 10 days
<style>
task {
  lineColor #181818
}
</style>
then [Task2] lasts 14 days

@endgantt

Enjoy,
Regards,
Th.

...