如果您执行下面的代码,您将得到不太好的输出(见下面的屏幕截图)。
我该如何修复:
- 组标签/栏是覆写里程碑。这不是我想要的。如何将第 1 组行移到里程碑下方?
- 里程碑完成后,就可以开始“小组”的工作了,所以我想要一个从里程碑到该组的第一个任务(“任务 2”)的线。如何做到这一点?如您所见,我得到了一条从组末尾到任务开头的线。如果无法做到这一点,我如何才能得到一条从里程碑到组开头以及从组开头到第一个任务的线?
谢谢
\documentclass{standalone}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}{1}{21}
\gantttitle{2015}{9}\gantttitle{2016}{12} \\
\gantttitlelist{4,...,12}{1}\gantttitlelist{1,...,12}{1} \\
\ganttbar{Task1}{3}{6} \\
\ganttlinkedmilestone{MyMilestone}{6}
\ganttgroup{Group}{7}{19} \\
\ganttbar{Task2}{7}{9} \\
\ganttlink{elem2}{elem3}
\end{ganttchart}
\end{document}
答案1
像这样?
\documentclass{standalone}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}{1}{21}
\gantttitle{2015}{9}\gantttitle{2016}{12} \\
\gantttitlelist{4,...,12}{1}\gantttitlelist{1,...,12}{1} \\
\ganttbar{Task1}{3}{6} \\
\ganttlinkedmilestone{MyMilestone}{6} \\
\ganttgroup{Group}{7}{19} \\
\ganttbar{Task2}{7}{9} \\
\ganttlink{elem1}{elem2}
\ganttlink{elem2}{elem3}
\end{ganttchart}
\end{document}
或者像这样?
\documentclass{standalone}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}{1}{21}
\gantttitle{2015}{9}\gantttitle{2016}{12} \\
\gantttitlelist{4,...,12}{1}\gantttitlelist{1,...,12}{1} \\
\ganttbar{Task1}{3}{6} \\
\ganttlinkedmilestone{MyMilestone}{6} \\
\ganttgroup{Group}{7}{19} \\
\ganttbar{Task2}{7}{9} \\
\ganttlink[ link mid=.25,]{elem1}{elem3} %% link bulge=1.3 if needed
%\ganttlink{elem2}{elem3}
\end{ganttchart}
\end{document}