如何在甘特图的边框添加空间?

如何在甘特图的边框添加空间?

我创建了甘特图,我想添加一些空间(如红色箭头处的空间),以便边框外没有图表箭头?

有什么办法吗?!

谢谢

当前甘特图

\begin{ganttchart}[
vgrid
]{1}{16}
\gantttitle{Weeks}{16} \\
\gantttitlecalendar{day} \\[grid]

\ganttgroup{Phase 1}{1}{5} \\
\ganttbar{System Analysis}{1}{3} \\
\ganttlinkedbar{System Design}{4}{5} \ganttnewline
\ganttmilestone{System Architecture}{5} \ganttnewline

\ganttgroup{Phase 3}{6}{13} \\
\ganttlinkedbar{System Implementation}{6}{8} \ganttnewline
\ganttlinkedbar{Benchmarks Implementation}{9}{12} \ganttnewline
\ganttmilestone{System and Benchmarks code}{12} \ganttnewline

\ganttgroup{Phase 4}{13}{13} \\
\ganttlinkedbar{System Evaluation}{13}{13} \ganttnewline
\ganttmilestone{Evaluation Results}{13} \ganttnewline

\ganttgroup{Phase 4}{14}{16} \\
\ganttbar{Documentation}{14}{16}\ganttnewline
\ganttmilestone{Milestone}{16} 

\ganttlink{elem1}{elem2}
\ganttlink{elem2}{elem3}
\ganttlink{elem3}{elem4}
\ganttlink{elem4}{elem5}
\ganttlink{elem5}{elem6}
\ganttlink{elem6}{elem7}
\ganttlink{elem7}{elem8}
\ganttlink{elem8}{elem9}
\ganttlink{elem9}{elem10}
\ganttlink{elem10}{elem11}
\ganttlink{elem11}{elem12}
\ganttlink{elem12}{elem13}

\end{ganttchart}

答案1

使图表从到{0}{17}并相应地调整标题和日历标题。对于,\calendartitle您需要使用星号版本,它允许您指定范围并添加偏移选项。

\documentclass{article}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}[
vgrid
]{0}{17}
\gantttitle{Weeks}{18} \\
\gantttitlecalendar*[title left shift=1,title right shift=1]{1}{16}{day}
 \\[grid]

\ganttgroup{Phase 1}{1}{5} \\
\ganttbar{System Analysis}{1}{3} \\
\ganttlinkedbar{System Design}{4}{5} \ganttnewline
\ganttmilestone{System Architecture}{5} \ganttnewline

\ganttgroup{Phase 3}{6}{13} \\
\ganttlinkedbar{System Implementation}{6}{8} \ganttnewline
\ganttlinkedbar{Benchmarks Implementation}{9}{12} \ganttnewline
\ganttmilestone{System and Benchmarks code}{12} \ganttnewline

\ganttgroup{Phase 4}{13}{13} \\
\ganttlinkedbar{System Evaluation}{13}{13} \ganttnewline
\ganttmilestone{Evaluation Results}{13} \ganttnewline

\ganttgroup{Phase 4}{14}{16} \\
\ganttbar{Documentation}{14}{16}\ganttnewline
\ganttmilestone{Milestone}{16} 

\ganttlink{elem1}{elem2}
\ganttlink{elem2}{elem3}
\ganttlink{elem3}{elem4}
\ganttlink{elem4}{elem5}
\ganttlink{elem5}{elem6}
\ganttlink{elem6}{elem7}
\ganttlink{elem7}{elem8}
\ganttlink{elem8}{elem9}
\ganttlink{elem9}{elem10}
\ganttlink{elem10}{elem11}
\ganttlink{elem11}{elem12}
\ganttlink{elem12}{elem13}

\end{ganttchart}
\end{document}

代码输出

相关内容