0

I wish to stretch out the gantt chart to be as wide as the margins on the right-hand side allow. Is there an edit that can be done that will do this regardless of how many elements I use?

\documentclass[a4paper,12pt,default,numbered,print,index]{article}
\usepackage{lipsum}
\usepackage{enumitem}
\usepackage{graphicx} % Required for the inclusion of images
\usepackage{setspace}        % for use of \singlespacing and \doublespacing
\usepackage{comment}
\usepackage{pdfpages}
\usepackage{mathtools} % for 'bmatrix' env.
\usepackage{geometry}  % set page parameters suitably
\usepackage{array} % for '\extrarowheight' macro
\renewcommand\arraystretch{1.33}
\usepackage{siunitx}
\usepackage{color}
\usepackage{lscape}
\usepackage{tabularx}
\usepackage{multirow}
\usepackage{array}
\usepackage{booktabs} % For professional looking tables
\usepackage{multirow}
\usepackage{pgfgantt}

\begin{document}

\newganttchartelement*{mymilestone}{
mymilestone/.style={
shape=isosceles triangle,
inner sep=0pt,
draw=cyan,
top color=white,
bottom color=cyan!50
},
mymilestone incomplete/.style={
/pgfgantt/mymilestone,
draw=yellow,
bottom color=yellow!50
},
mymilestone label font=\slshape,
mymilestone left shift=0pt,
mymilestone right shift=0pt
}

\newgantttimeslotformat{stardate}{%
\def\decomposestardate##1.##2\relax{%
\def\stardateyear{##1}\def\stardateday{##2}%
}%
\decomposestardate#1\relax%
\pgfcalendardatetojulian{\stardateyear-10-01}{#2}%
\advance#2 by-1\relax%
\advance#2 by\stardateday\relax%
}

\hspace*{-2.5cm}
\begin{ganttchart}[vgrid, hgrid]{1}{17}
\gantttitle{September 2017}{4}
\gantttitle{October 2017}{4}
\gantttitle{November 2017}{5}
\gantttitle{December 2017}{4}\\
\gantttitlelist{1,...,17}{1}\\
\ganttgroup{\footnotesize Year 1}{1}{12} \\
\end{ganttchart}

\end{document}

enter image description here

1 Answer 1

3

in your case you can scale the width of time slot by x unit like below:

\documentclass[a4paper,12pt]{article}
\usepackage{pgfgantt}

\begin{document}

\hspace*{-2.5cm}
\begin{ganttchart}[vgrid, hgrid, x unit=.9cm]{1}{17}
\gantttitle{September 2017}{4}
\gantttitle{October 2017}{4}
\gantttitle{November 2017}{5}
\gantttitle{December 2017}{4}\\
\gantttitlelist{1,...,17}{1}\\
\ganttgroup{\footnotesize Year 1}{1}{12} \\
\end{ganttchart}

\end{document}

enter image description here

0

You must log in to answer this question.

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