![如何在甘特图中添加月份?](https://linux22.com/image/340953/%E5%A6%82%E4%BD%95%E5%9C%A8%E7%94%98%E7%89%B9%E5%9B%BE%E4%B8%AD%E6%B7%BB%E5%8A%A0%E6%9C%88%E4%BB%BD%EF%BC%9F.png)
我制作了包含周数的甘特图,但在周数之上,我想添加相应的月份(例如,31 日至 34 日是 8 月),我该怎么做?
这是我的代码。
\documentclass[tikz]{standalone}
\usepackage{pgfgantt}
\title{Gantt Charts with the pgfgantt Package}
\begin{document}
\begin{ganttchart}{31}{53}
\gantttitle{2016}{22} \\
\gantttitlelist{31,...,52}{1} \\
\ganttgroup{Problem formulation}{31}{31} \\
\ganttbar{Literature review}{32}{35} \\
\ganttlinkedbar{Data collection}{36}{39} \ganttnewline
\ganttlinkedbar{Value chain analysis}{40}{43}
\ganttnewline
\ganttlinkedbar{Strategic framework}{44}{48}
\ganttnewline
\ganttlinkedbar{Inspect report and wrap up}{49}{52}
\ganttnewline
\ganttmilestone{Hand-in}{52}
\ganttlink{elem5}{elem6}
% \ganttlink{elem3}{elem4}
\end{ganttchart}
\end{document}
谢谢!
答案1
您可以添加更多 \gantttitle 命令:
\documentclass[tikz]{standalone}
\usepackage{pgfgantt}
\title{Gantt Charts with the pgfgantt Package}
\begin{document}
\begin{ganttchart}{31}{53}
\gantttitle{2016}{22} \\
\gantttitle[title/.style={draw=none,}]{}{3}
\gantttitle{August}{4}
\gantttitle{September}{4}\\
\gantttitlelist{31,...,52}{1} \\
\ganttgroup{Problem formulation}{31}{31} \\
\ganttbar{Literature review}{32}{35} \\
\ganttlinkedbar{Data collection}{36}{39} \ganttnewline
\ganttlinkedbar{Value chain analysis}{40}{43}
\ganttnewline
\ganttlinkedbar{Strategic framework}{44}{48}
\ganttnewline
\ganttlinkedbar{Inspect report and wrap up}{49}{52}
\ganttnewline
\ganttmilestone{Hand-in}{52}
\ganttlink{elem5}{elem6}
% \ganttlink{elem3}{elem4}
\end{ganttchart}
\end{document}