2

I would like align the titles of my gantt-chart on the left.

For the moment I have something like this: enter image description here

but I would like the numbers (0, 0.2, 0.4, etc.) to be place on the left, not in the middle.

Does someone know how to do it? Or is there a better way to do it than using pgfgantt?

My code lookes like that:

\begin{ganttchart}[ 
expand chart=\textwidth,
]{1}{20} 
[vgrid={draw=none, dotted}]{1}{20}
\gantttitle{0} {2} 
\gantttitle{0.2}{2}
\gantttitle{0.4}{2}
\gantttitle{0.6}{2}
\gantttitle{0.8}{2}
\gantttitle{1.0}{2}
\gantttitle{1.2}{2}
\gantttitle{1.4}{2}
\gantttitle{1.6}{2}
\gantttitle{1.8}{2} \\

\ganttbar{Process 1}{4}{7} \\ 
\ganttbar{Process 2}{3}{6} \\ 
\end{ganttchart}

Thanks in advance!

1 Answer 1

1

With 0 transformed into 0.0 as I am assuming that you want the same distance from the left.

\documentclass{article}
\usepackage{pgfgantt}


\begin{document}

\begin{ganttchart}[ 
title label node/.append style={anchor=east,xshift=1mm},
expand chart=\textwidth,
]{1}{20} 
[vgrid={draw=none, dotted}]{1}{20}
%\gantttitle{0} {2} 
\gantttitle{0.0} {2} 
\gantttitle{0.2}{2}
\gantttitle{0.4}{2}
\gantttitle{0.6}{2}
\gantttitle{0.8}{2}
\gantttitle{1.0}{2}
\gantttitle{1.2}{2}
\gantttitle{1.4}{2}
\gantttitle{1.6}{2}
\gantttitle{1.8}{2} \\

\ganttbar{Process 1}{4}{7} \\ 
\ganttbar{Process 2}{3}{6} \\ 
\end{ganttchart}

\end{document}

enter image description here

1
  • This is exactly what I was looking for, thanks a lot!
    – Hello3456
    Sep 7, 2021 at 10:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.