创建甘特图错误

创建甘特图错误

出现错误 pgfkeys:我不知道密钥 /pgfgantt/group peaks。我无论如何也找不到问题所在。有人能帮我解决这个问题吗?谢谢

% Out line proposal

\documentclass{article}
\usepackage{pgfgantt}
\usepackage{rotating}
\title{Outline Proposal}
\author{Teresa Green}

% End of preamble, beginning of proposal outline document

\begin{document}
\maketitle    begin{figure}[ftbp]
\section{Workplan}
\begin{sideways}
\begin{minipage}{20cm}
\begin{center}
\begin{ganttchart}[y unit title=0.4cm,
y unit chart=0.5cm,
vgrid,hgrid, 
title label anchor/.style={below=-1.6ex},
title left shift=.05,
title right shift=-.05,
title height=1,
bar/.style={fill=gray!50},
incomplete/.style={fill=white},
progress label text={},
bar height=0.7,
group right shift=0,
group top shift=.6,
group height=.3,
group peaks={}{}{.2}]{34}

%labels

\gantttitle{Project}{34} \\
\gantttitle{Sep}{1} 
\gantttitle{Oct}{4} 
\gantttitle{Nov}{4} 
\gantttitle{Dec}{4} 
\gantttitle{Jan}{4} 
\gantttitle{Feb}{4} 
\gantttitle{Mar}{4} 
\gantttitle{Apr}{4} 
\gantttitle{May}{4}  
\gantttitle{Jun}{1}\
%tasks

\ganttbar{Outline Proposal}{1}{2} \\
\ganttbar{Research}{3}{8} \\
\ganttbar{Literature Review}{9}{10} \\
\ganttbar{Ethics Test}{11}{15} \\
\ganttbar[progress=33]{Progress Report}{20}{22} \\
\ganttbar{Final Report}{18}{19} \\
\ganttbar{task 7}{16}{18} \\
\ganttbar[progress=0]{Demonstration}{21}{34}

%relations

\ganttlink{elem0}{elem1} 
\ganttlink{elem0}{elem3} 
\ganttlink{elem1}{elem2} 
\ganttlink{elem3}{elem4} 
\ganttlink{elem1}{elem5} 
\ganttlink{elem3}{elem5} 
\ganttlink{elem2}{elem6} 
\ganttlink{elem3}{elem6} 
\ganttlink{elem5}{elem7} 
\end{ganttchart}
\end{center}
\caption{Gantt Chart - Workplan}
\end{minipage}
\end{sideways}
\end{figure}
\end{document}

答案1

ganttchart需要两个强制参数,所以我改成{34}{1}{34},但我没有看到group peaks键,但有以该字符串开头的键,所以我选了group keys height这里,不确定意图是什么。此操作运行无错误。

无论如何,由于您正在使用那个包,所以sidewaysfigure也没有f浮点数的选项。

\documentclass{article}
\usepackage{pgfgantt}
\usepackage{rotating}
\title{Outline Proposal}
\author{Teresa Green}

% End of preamble, beginning of proposal outline document

\begin{document}
\maketitle

\section{Workplan}

\begin{sidewaysfigure}

\centering
\begin{ganttchart}[y unit title=0.4cm,
y unit chart=0.5cm,
vgrid,hgrid, 
title label anchor/.style={below=-1.6ex},
title left shift=.05,
title right shift=-.05,
title height=1,
bar/.style={fill=gray!50},
incomplete/.style={fill=white},
progress label text={},
bar height=0.7,
group right shift=0,
group top shift=.6,
group height=.3,
group peaks height =.2
]
{1}{34}
%labels
\gantttitle{Project}{34} \\
\gantttitle{Sep}{1} 
\gantttitle{Oct}{4} 
\gantttitle{Nov}{4} 
\gantttitle{Dec}{4} 
\gantttitle{Jan}{4} 
\gantttitle{Feb}{4} 
\gantttitle{Mar}{4} 
\gantttitle{Apr}{4} 
\gantttitle{May}{4}  
\gantttitle{Jun}{1}\\
%tasks
\ganttbar{Outline Proposal}{1}{2} \\
\ganttbar{Research}{3}{8} \\
\ganttbar{Literature Review}{9}{10} \\
\ganttbar{Ethics Test}{11}{15} \\
\ganttbar[progress=33]{Progress Report}{20}{22} \\
\ganttbar{Final Report}{18}{19} \\
\ganttbar{task 7}{16}{18} \\
\ganttbar[progress=0]{Demonstration}{21}{34}

%relations

\ganttlink{elem0}{elem1} 
\ganttlink{elem0}{elem3} 
\ganttlink{elem1}{elem2} 
\ganttlink{elem3}{elem4} 
\ganttlink{elem1}{elem5} 
\ganttlink{elem3}{elem5} 
\ganttlink{elem2}{elem6} 
\ganttlink{elem3}{elem6} 
\ganttlink{elem5}{elem7} 
\end{ganttchart}

\caption{Gantt Chart - Workplan}

\end{sidewaysfigure}
\end{document}

相关内容