Is it possible to color the days in the default Gantt Diagram?

0 votes
asked Sep 3 in Question / help by SuperSaiyanGod (280 points)

For the Gantt Diagram of the calendar form (that starts with something like

Project starts the 2020/09/01

), you can color the days with the following statement:

2020/09/13 to 2020/09/16 are colored in lightblue

But it seems impossible to color the days without that initial statement. (I tried "Day1" and "Day 1", but neither worked.)

(It may sounds a bit strange, but I'm currently using Gantt Diagram to demonstrate how variables change in a program process, so the calendar form isn't what I want.)

commented Sep 3 by The-Lu (31,620 points)

Hello. S,

  • What is 'Day1' or 'Day 1'?

Regards,
Th.

commented Sep 16 by The-Lu (31,620 points)

Hello S.,

I'm currently using Gantt Diagram to demonstrate how variables change in a program process, so the calendar form isn't what I want.

Have you an example of your works in progress...
in order to confirm the implementation, and also to put with all the other doc.

Regards,
Th.

1 Answer

0 votes
answered Sep 3 by The-Lu (31,620 points)

Hello S.,

Here is a proposal:

@startgantt
<style>
ganttDiagram {
  timeline {
    'LineColor transparent
    FontColor transparent
  }
}
</style>

hide footbox
project starts the 2021/01/01
2021/01/05 to 2021/01/07 are colored in lightblue

[Var. A] as [A] lasts 9 days
[Var. B] as [B] lasts 5 days
[B] starts at [A]'s end
[A] is colored in Fuchsia/FireBrick
[B] is colored in GreenYellow/Green

2021/01/11 is colored in gold
2021/01/12 is colored in orange
2021/01/13 is colored in red
-- note --
@endgantt

See also doc. here; see 'Clean style', on:

If that can help,
Regards,
Th.

commented Sep 6 by SuperSaiyanGod (280 points)

"Day 1" and "Day1" are just like the date in the statement

2021/01/11 is colored in gold

except that they represent the first day in the diagram. I don't want to use exact dates because, basically, I just care about how many days have passed since the first day. 

commented Sep 6 by The-Lu (31,620 points)

Hello S.,

Perhaps, you can create a 'wanted feature' for that.

Regards,
Th.

commented Sep 14 by plantuml (257,940 points)

Last beta http://beta.plantuml.net/plantuml.jar supports now "D+xx" notation. So you can have:

@startgantt
project starts the 2021/01/01
2021/01/05 to 2021/01/07 are colored in lightblue
D+13 to D+15 are colored in blue

[Var. A] as [A] lasts 9 days
[Var. B] as [B] lasts 5 days
[C] lasts 10 days
[B] starts at [A]'s end
[A] is colored in Fuchsia/FireBrick
[B] is colored in GreenYellow/Green
[C] starts at D+16


D+10 is colored in gold
D+11 is colored in orange
D+8 is colored in red
-- note --
@endgantt

http://www.plantuml.com/plantuml/uml/NL7BJiGm3BpxAtpZW4hRHULnMmfQ_W09hJYOrce3KO8Shn1_Jrowx2fIfB5cnXudsIObqOc2Adn9_E11SQ4IwiouQJPjtTY1_x93ZIVX5aaOX-YZy8Wke7VJhE_-mF1qsLwRDsDNkXO3x5z8hl3X3IdXFeEdb8FlSQIVj8hzdzWVnMuL7uz4swnCjgoRazgqYuGSHh2vBfrdxmx3d1pLEoVSYni-Ss_fUHRcyChUn-zwgItnDD_kT0C06PgYSuf-DBuj-2WK9dkKkqB805M58IfZLS4sBxtynoy0

Is this what you were looking for ?

commented Sep 14 by The-Lu (31,620 points)

Hello PlantUML team,

Fine, but:

  • Is it possible to works without 'project start date', like:
@startgantt

D+13 to D+15 are colored in blue

[Var. A] as [A] lasts 9 days
[Var. B] as [B] lasts 5 days
[C] lasts 10 days
[B] starts at [A]'s end
[A] is colored in Fuchsia/FireBrick
[B] is colored in GreenYellow/Green
[C] starts at D+16

D+10 is colored in gold
D+11 is colored in orange
D+8 is colored in red
-- note --
@endgantt

With 'D' is the first day and 'D+1' the second day, and so on...

Regards,
Th.

commented Sep 15 by plantuml (257,940 points)

You're right!

With last beta http://beta.plantuml.net/plantuml.jar you can now have :

@startgantt
D+13 to D+15 are colored in blue

[Var. A] as [A] lasts 9 days
[Var. B] as [B] lasts 5 days
[C] lasts 10 days
[B] starts at [A]'s end
[A] is colored in Fuchsia/FireBrick
[B] is colored in GreenYellow/Green
[C] starts at D+16


D+10 is colored in gold
D+11 is colored in orange
D+8 is colored in red
-- note --
@endgantt

There is a slight issue: for example D+8 (is in red) is a shortcut for D9 (see red column in the example).

This is because D+0 is the first day (1), D+1 is the second day (2).

It's logical but it's weird. Maybe we should number day starting at 0 on the drawing instead of 1.

What do you think about it ?

commented Sep 16 by The-Lu (31,620 points)

Hello PlantUML team,

There is a slight issue: for example D+8 (is in red) is a shortcut for D9 (see red column in the example).

This is because D+0 is the first day (1), D+1 is the second day (2).

It's logical but it's weird. Maybe we should number day starting at 0 on the drawing instead of 1.

What do you think about it ?

Without going into controversy on the 'Zero-based_numbering'.

If it is easier to understand, why not change to:

  • D+1 is the first day (1), D+2 is the second day (2).

But how to consolidate the two kind of uses:

CodeOutput
@startgantt
project starts the 2021/01/10

D+5 to D+7 are colored in blue

[C] lasts 2 days
[C] starts at D+1

D+10 is colored in gold
D+11 is colored in orange
D+12 is colored in red

@endgantt

Why D+12 is not red ???
@startgantt
' Without project start date
D+5 to D+7 are colored in blue

[C] lasts 2 days
[C] starts at D+1

D+10 is colored in gold
D+11 is colored in orange
D+12 is colored in red

@endgantt


Perhaps create 2 behaviours, depending if there is a start date (if it is the 10-01-2021):

  • then D+0 is the start date, D+1 is the first day after start date (11-01-2021), D+2 is the second day (12-01),...

or if there is not start date (only number):

  • in that case: D+1 is the first day (1), D+2 is the second day (2), ...

Hoping that I am clear.
Regards,
Th.

...