need help to reduce the vertical spacing of the grid in a Gant chart. Tried several attempts with y grid and so on, but noting works. Hope someone can help!

\begin{center}
\begin{tikzpicture}[y=0.1cm]  
\begin{ganttchart}[vgrid,hgrid,title height=.75, title top shift=0]{1}{25}
\ganttset{bar height=0.2}
\gantttitle{Week}{25} \\
\gantttitlelist{1,...,25}{1}\\
\ganttbar{Task 1}{2}{4} \\
\ganttbar{Task 2}{5}{6} \\
\ganttmilestone{M 1}{6} \\
\ganttbar{Task 3}{7}{11}
\ganttlink{elem0}{elem1}
\ganttlink{elem1}{elem2}
\ganttlink{elem2}{elem3}
\end{ganttchart}
\end{tikzpicture}
\end{center}
  • Welcome to TeX.SE! Please provide us with a complete code that also has an appropriate preamble, i.e. starts with \documentclass and ends with \end{document}. BTW, to mark code as such, put it in the cursor and press the {} button while editing. And as for your question: you probably need only to replace [y=0.1cm] by [yscale=0.7,transform shape] or another scale factor. – marmot Nov 8 at 19:39
up vote 1 down vote accepted

Welcome to TeX.SE! Here is a proposal.

\documentclass{article}
\usepackage{pgfgantt}

\begin{document}
\begin{center}

\begin{tikzpicture}[/pgfgantt/y unit chart=0.7cm]  
\begin{ganttchart}[vgrid,hgrid,title height=.75, title top shift=0]{1}{25}
\ganttset{bar height=0.2}
\gantttitle{Week}{25} \\
\gantttitlelist{1,...,25}{1}\\
\ganttbar{Task 1}{2}{4} \\
\ganttbar{Task 2}{5}{6} \\
\ganttmilestone{M 1}{6} \\
\ganttbar{Task 3}{7}{11}
\ganttlink{elem0}{elem1}
\ganttlink{elem1}{elem2}
\ganttlink{elem2}{elem3}
\end{ganttchart}
\end{tikzpicture}
\end{center}
\end{document}

enter image description here

This is a so-called minimal working example (MWE), which can just be copied and compiled to make life easier for everyone.

  • Thank you so much, do you mayb have a fix for the suppressed text on the side? Because I want to go very low in scale :) @marmot – ssaether Nov 8 at 19:47
  • @user174212 What precisely do you mean by "suppressed text on the side"? (As far as I can see the text is still there, or am I missing something?) – marmot Nov 8 at 19:50
  • ohh, sorry for my bad formulation.. I mean that the text gets pressed together in the vertical direction, and do you maybe have a fix to limit that. Trying to save space since i have 46 tasks going in. @marmot – ssaether Nov 8 at 19:56
  • @user174212 Yes, I changed my answer accordingly. – marmot Nov 8 at 20:04
  • Ohh, Thank you so much for taking you time! @marmot – ssaether Nov 8 at 20:09

Your Answer

 

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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