甘特图:如何从甘特图组中删除进度条

甘特图:如何从甘特图组中删除进度条

我正在尝试从甘特图(甘特图组)的顶行移除进度条。我想将该行用作各个项目的标题。例如,我希望“项目 1”行留空,或者没有进度条。

\documentclass{article}
\usepackage{pgfgantt}

\begin{document}

\begin{ganttchart}[
    x unit = 0.75cm,
    y unit title=0.5cm,
    y unit chart=0.5cm,
    vgrid, hgrid,
    title height=1,
    group label font=\bfseries\footnotesize,
    milestone label font=\scriptsize,
    bar label font=\scriptsize,
    title label font=\bfseries\scriptsize,
    bar/.style={fill=blue},
    bar height=0.7,
    group right shift=0,
    group height=.7,
    group peaks width={0.2},
    inline]{1}{13}

    \gantttitle{2018}{5}                
    \gantttitle[]{2019}{8} \\
    \gantttitle{Aug}{1}
    \gantttitle{Sep}{1}
    \gantttitle{Oct}{1}
    \gantttitle{Nov}{1}
    \gantttitle{Dec}{1}
    \gantttitle{Jan}{1}                     
    \gantttitle{Feb}{1}
    \gantttitle{Mar}{1}
    \gantttitle{Apr}{1}
    \gantttitle{May}{1}
    \gantttitle{Jun}{1}
    \gantttitle{Jul}{1}
    \gantttitle{Aug}{1}\\

\ganttgroup[progress=60,inline=false]{Project 1}{1}{8} \\ 
    \ganttbar[progress=100,inline=false]{Task 1}{1}{2} \\ 
    \ganttbar[progress=80,inline=false]{Task 2}{1}{4} \\ 
    \ganttbar[progress=60,inline=false]{Task 3}{1}{8}\\ 
    \ganttbar[progress=20,inline=false]{Task 4}{1}{8} 

\end{ganttchart}

\end{document}

例子

答案1

欢迎使用 TeX.SE!只需为甘特图组提供一个空样式(参见手册第 27 页顶部)。

\documentclass{article}
\usepackage{pgfgantt}

\begin{document}

\begin{ganttchart}[
    x unit = 0.75cm,
    y unit title=0.5cm,
    y unit chart=0.5cm,
    vgrid, hgrid,
    title height=1,
    group label font=\bfseries\footnotesize,
    milestone label font=\scriptsize,
    bar label font=\scriptsize,
    title label font=\bfseries\scriptsize,
    bar/.style={fill=blue},
    bar height=0.7,
    group right shift=0,
    group height=.7,
    group peaks width={0.2},
    inline]{1}{13}

    \gantttitle[]{2018}{5}                
    \gantttitle[]{2019}{8} \\
    \gantttitle{Aug}{1}
    \gantttitle{Sep}{1}
    \gantttitle{Oct}{1}
    \gantttitle{Nov}{1}
    \gantttitle{Dec}{1}
    \gantttitle{Jan}{1}                     
    \gantttitle{Feb}{1}
    \gantttitle{Mar}{1}
    \gantttitle{Apr}{1}
    \gantttitle{May}{1}
    \gantttitle{Jun}{1}
    \gantttitle{Jul}{1}
    \gantttitle{Aug}{1}\\

\ganttgroup[/pgfgantt/group/.style={},inline=false]{Project 1}{1}{8} \\ 
    \ganttbar[progress=100,inline=false]{Task 1}{1}{2} \\ 
    \ganttbar[progress=80,inline=false]{Task 2}{1}{4} \\ 
    \ganttbar[progress=60,inline=false]{Task 3}{1}{8}\\ 
    \ganttbar[progress=20,inline=false]{Task 4}{1}{8} 

\end{ganttchart}

\end{document}

在此处输入图片描述

相关内容