I want to create a diagram very similar to a Gantt chart. But it is in face run times from a workflow execution and they can be from milliseconds up to weeks...

I am looking at pgfgant but I am not really sure how to give my times. My first thought was to jsut use the milliseconds like this:

    \ganttbar{fooer}{0}{1530175800-1530175200} \\
    \ganttbar{foo2bar}{1530175800-1530175200}{1530176220-1530175200} \\

But this gives: ! Dimension too large., it seems to me like the other supported formats deals with year-month-day, but I also need all the way down to milliseconds pretty much. Can I still use the pgfgantt package in some clever way?

  • 1
    How would you like the output to look? Some kind of log scale? Otherwise the millisecond entries would be too small to be seen and/or the week-long entries would be too large to fit on the page.
    – Marijn
    Commented Jun 29, 2018 at 11:48
  • Well I want to scale the entire picture. If there are things that take weeks then the entire scale would be weeks if it is milliseconds then the entire scale would be in milliseconds. If there are both then of crourse milliseconds will be nothing compared to weeks...
    – jonalv
    Commented Jun 29, 2018 at 11:55

1 Answer 1


One possible solution in case the numbers are too big is to make them smaller. In the example below the milliseconds are given starting from a predefined time (hh:mm) and divided by 100 (i.e., the unit is 0.1 second). The title list is given in seconds.

For display on the chart the timestamp is (very rudimentary) constructed by printing the number of seconds after the starting time and adding a leading zero if necessary. Of course this computation can be improved by considering minutes, hours, leap seconds etc.

Note that the new command is initially not expanded to prevent the awakening of the Black LaTeX Sorcerer of Doom and Enigmatic Errors.


% add leading zero

\gantttitle{Thursday 8:36am}{50} \\
    title list options=%
    {var=\y, evaluate=\y as \x using "\noexpand\showtimestamp{8:36}{\y}"}
]{0,...,4}{10} \\
\ganttbar{fooer}{2.0}{8.0} \\
\ganttbar{foo2bar}{8.0}{12.2} \\


Partial result:

enter image description here

  • Hm I beginning to realise that the Gantt chart is divided into a given number of pieces and blocks has to start and stop at such a piece. That's the case right? Then I guess I would have to do a bunch of rounding. Have to thinkg about whether that is a problem in practice...
    – jonalv
    Commented Jun 29, 2018 at 14:09
  • That's how it works indeed. Note that you don't have to round yourself, pgfgantt will truncate the values automatically (e.g., the 12.2 in my example is drawn at position 12).
    – Marijn
    Commented Jun 29, 2018 at 14:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .