Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mermaid.ganttConfig custom colors based on RAG status #5323

Open
alex-papaioannou opened this issue Feb 26, 2024 · 1 comment
Open

mermaid.ganttConfig custom colors based on RAG status #5323

alex-papaioannou opened this issue Feb 26, 2024 · 1 comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request

Comments

@alex-papaioannou
Copy link

Proposal

mermaid.ganttConfig should add custom colors for each RAG status. e.g. It will help immensely to be able to have something like:
mermaid.ganttConfig = {
completedStatusColor: blue
activeOnTrackStatusColor: green
activeAtRiskStatusColor: yellow
delayedStatusColor: red
notStartedStatusColor: gray

titleTopMargin: 25, // Margin top for the text over the diagram
barHeight: 20, // The height of the bars in the graph
barGap: 4, // The margin between the different activities in the gantt diagram
topPadding: 75, // Margin between title and gantt diagram and between axis and gantt diagram.
rightPadding: 75, // The space allocated for the section name to the right of the activities
leftPadding: 75, // The space allocated for the section name to the left of the activities
gridLineStartPadding: 10, // Vertical starting position of the grid lines
fontSize: 12, // Font size
sectionFontSize: 24, // Font size for sections
numberSectionStyles: 1, // The number of alternating section styles
axisFormat: '%d/%m', // Date/time format of the axis
tickInterval: '1 week', // Axis ticks
topAxis: true, // When this flag is set, date labels will be added to the top of the chart
displayMode: 'compact', // Turns compact mode on
weekday: 'sunday', // On which day a week-based interval should start
};

Colors

  • fillcolor

Screenshots

n/a

@alex-papaioannou alex-papaioannou added Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request labels Feb 26, 2024
@bhofmei
Copy link

bhofmei commented Aug 8, 2024

Its not as convenient, but this can be overcome with CSS classes for the 6 current tag combinations. These are the class names to use.

  • No tag: .task0, .task1, .task2, .task3
  • Active: .active0, .active1, .active2, .active3
  • Active Critical: .activeCrit0, .activeCrit1, .activeCrit2, .activeCrit3
  • Critical: .crit0, .crit1, .crit2, .crit3
  • Done: .done0, .done1, .done2, .done3
  • Done Critical: .doneCrit0, .doneCrit1, .doneCrit2, .doneCrit3

You would set fill and stroke for these objects and you'll need to include !important.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Status: Triage Needs to be verified, categorized, etc Type: Enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants