gantt multiline header: "endheader" not recognized with gantt (@startgantt )

0 votes
asked Jul 24, 2024 in Question / help by woody (140 points)

This example which works with @startuml doesn't work with @startgantt 

@startgantt
header
<font color=red>Warning:</font>
Do not use in production.

endheader
@endgantt

Error java.lang.ClassCastException: net.sourceforge.plantuml.project.GanttDiagram cannot be cast to net.sourceforge.plantuml.UmlDiagram
java.lang.ClassCastException: net.sourceforge.plantuml.project.GanttDiagram cannot be cast to net.sourceforge.plantuml.UmlDiagram
        at net.sourceforge.plantuml.command.CommandMultilinesHeader.execute(CommandMultilinesHeader.java:72)
        at net.sourceforge.plantuml.command.CommandMultilinesHeader.execute(CommandMultilinesHeader.java:47)
        at net.sourceforge.plantuml.command.ProtectedCommand.execute(ProtectedCommand.java:57)
        at net.sourceforge.plantuml.AbstractPSystem.executeCommand(AbstractPSystem.java:186)
        at net.sourceforge.plantuml.command.PSystemCommandFactory.executeFewLines(PSystemCommandFactory.java:125)
        at net.sourceforge.plantuml.command.PSystemCommandFactory.createSystem(PSystemCommandFactory.java:108)
        at net.sourceforge.plantuml.PSystemBuilder.createPSystem(PSystemBuilder.java:161)
        at net.sourceforge.plantuml.BlockUml.getDiagram(BlockUml.java:188)
        at net.sourceforge.plantuml.picoweb.PicoWebServer.handleGET(PicoWebServer.java:230)
        at net.sourceforge.plantuml.picoweb.PicoWebServer.run(PicoWebServer.java:126)
        at java.lang.Thread.run(Unknown Source)
You should send a mail to plantuml@gmail.com or post to https://plantuml.com/qa with this log (V1.2024.6)

2 Answers

0 votes
answered Jul 25, 2024 by The-Lu (89,080 points)

Hello W.,

You are right, multi-line header is not yet managed on Gantt..

Here is a workaround, using mono-line header, as:

@startgantt
header <font color=red>Warning:</font>\nDo not use in production.
title a title
@endgantt

Enjoy,

Regards,
Th.

0 votes
answered Mar 20 by The-Lu (89,080 points)

Hello W.,

That is now fixed (observed on v1.2026.3+)

Regards,
Th.

...