移动甘特图

移动甘特图

请问如何让甘特图的内容移到页面下方?它太接近(灰色)年/月/周了。

\documentclass{article}
\usepackage{pgfgantt}
\usepackage{rotating}

\newcounter{myWeekNum}
\stepcounter{myWeekNum}

\newcommand{\myWeek}{\themyWeekNum
    \stepcounter{myWeekNum}
    \ifnum\themyWeekNum=53
         \setcounter{myWeekNum}{1}
    \else\fi
}

\begin{document}

\label{sec:appenA}

\setcounter{myWeekNum}{1}
\ganttset{calendar week text={\myWeek{}}
}

\begin{sideways}
    \begin{ganttchart}[
        x unit=0.11cm, %1.3cm,
        y unit title=0.4cm,
        y unit chart=0.6cm,
        time slot format=isodate,
        title/.append style={shape=rectangle, fill=black!10},
        title height=1,
        bar/.append style={fill=green!90},
        bar height=.6,
        bar label font=\normalsize\color{black!50},
        group top shift=0.9,
        group height=.2,
        group peaks height=.15, bar incomplete/.append style={fill=green!40}
        ]{2024-01-15}{2024-06-30}
        \gantttitlecalendar{year, month=name, week}%year, month=shortname} \\
        \ganttset{progress label text={}, %bar height=.6,
            bar incomplete/.append style={fill=green!40},
            group/.append style={draw=black, fill=green},} % this suppresses percentage done labels
        \ganttgroup{Task 1: Research Design}{2024-01-29}{2024-03-15} \\
        \ganttbar[progress=00, name=rclone]{Explore topic}{2024-01-29}{2024-02-02} \\

        \ganttbar[progress=00, name=kover]{Preliminary Introduction}{2024-01-29}{2024-02-23} \\
        \ganttlinkedbar[progress=00, name=koflr]{Literature Review}{2024-02-15}{2024-03-08} \\
        \ganttlinkedbar[progress=00, name=koflr2]{Research Methodology}{2024-03-15}{2024-03-15} \\
        \ganttset{bar incomplete/.append style={fill=red!40},
            group/.append style={draw=black, fill=red},}
        \ganttgroup{Task 2: Data Collection}{2024-03-25}{2024-04-26} \\
        \ganttbar[progress=00, name=oeclone]{Interviews}{2024-03-25}{2024-04-26} \\
        \ganttset{bar incomplete/.append style={fill=yellow!40},
            group/.append style={draw=black, fill=yellow},}
        \ganttgroup{Task 3: Thematic Analysis}{2024-04-12}{2024-05-24} \\
        \ganttbar[progress=00, name=themA]{Transcription}{2024-04-12}{2024-04-26} \\
        \ganttlinkedbar[progress=00, name=rnagrow]{Coding}{2024-04-22}{2024-05-10} \\

        \ganttlinkedbar[progress=00, name=rnaanal]{ Classification}{2024-04-22}{2024-05-24} \\
        \ganttset{bar incomplete/.append style={fill=blue!40},
            group/.append style={draw=black, fill=blue},}
        \ganttgroup{Task 4: Collation}{2024-05-13}{2024-06-21} \\
        \ganttbar[progress=00, name=chipgrow]{Final Analysis}{2024-05-13}{2024-05-24} \\
        \ganttlinkedbar[progress=00, name=chipdev]{Final Review}{2024-05-20}{2024-06-14} \\
        \ganttlinkedbar[progress=00, name=chipanal]{Presentation and Submission}{2024-06-17}{2024-06-21} \\
        \ganttset{progress label text={}}
        \ganttlink[]{koflr2}{oeclone}
        \ganttlink[]{oeclone}{themA}

        \ganttlink[]{rnaanal}{chipgrow}

    \end{ganttchart}
\end{sideways}

\end{document}

答案1

除了将内容向下移动,您还可以将标题向上移动,如下所示title top shift=-2

\documentclass{article}
\usepackage{pgfgantt}
\usepackage{rotating}

\newcounter{myWeekNum}
\stepcounter{myWeekNum}

\newcommand{\myWeek}{\themyWeekNum
    \stepcounter{myWeekNum}
    \ifnum\themyWeekNum=53
         \setcounter{myWeekNum}{1}
    \else\fi
}

\begin{document}

\label{sec:appenA}

\setcounter{myWeekNum}{1}
\ganttset{calendar week text={\myWeek{}}
}

\begin{sideways}
    \begin{ganttchart}[
        x unit=0.11cm, %1.3cm,
        y unit title=0.4cm,
        y unit chart=0.6cm,
        time slot format=isodate,
        title/.append style={shape=rectangle, fill=black!10},
        title height=1,
        bar/.append style={fill=green!90},
        bar height=.6,
        bar label font=\normalsize\color{black!50},
        group top shift=0.9,
        group height=.2,
        group peaks height=.15, bar incomplete/.append style={fill=green!40},
        title top shift=-2
        ]{2024-01-15}{2024-06-30}
        \gantttitlecalendar[]{year, month=name, week}%year, month=shortname} \\
        \ganttset{progress label text={}, %bar height=.6,
            bar incomplete/.append style={fill=green!40},
            group/.append style={draw=black, fill=green},} % this suppresses percentage done labels
        \ganttgroup{Task 1: Research Design}{2024-01-29}{2024-03-15} \\
        \ganttbar[progress=00, name=rclone]{Explore topic}{2024-01-29}{2024-02-02} \\

        \ganttbar[progress=00, name=kover]{Preliminary Introduction}{2024-01-29}{2024-02-23} \\
        \ganttlinkedbar[progress=00, name=koflr]{Literature Review}{2024-02-15}{2024-03-08} \\
        \ganttlinkedbar[progress=00, name=koflr2]{Research Methodology}{2024-03-15}{2024-03-15} \\
        \ganttset{bar incomplete/.append style={fill=red!40},
            group/.append style={draw=black, fill=red},}
        \ganttgroup{Task 2: Data Collection}{2024-03-25}{2024-04-26} \\
        \ganttbar[progress=00, name=oeclone]{Interviews}{2024-03-25}{2024-04-26} \\
        \ganttset{bar incomplete/.append style={fill=yellow!40},
            group/.append style={draw=black, fill=yellow},}
        \ganttgroup{Task 3: Thematic Analysis}{2024-04-12}{2024-05-24} \\
        \ganttbar[progress=00, name=themA]{Transcription}{2024-04-12}{2024-04-26} \\
        \ganttlinkedbar[progress=00, name=rnagrow]{Coding}{2024-04-22}{2024-05-10} \\

        \ganttlinkedbar[progress=00, name=rnaanal]{ Classification}{2024-04-22}{2024-05-24} \\
        \ganttset{bar incomplete/.append style={fill=blue!40},
            group/.append style={draw=black, fill=blue},}
        \ganttgroup{Task 4: Collation}{2024-05-13}{2024-06-21} \\
        \ganttbar[progress=00, name=chipgrow]{Final Analysis}{2024-05-13}{2024-05-24} \\
        \ganttlinkedbar[progress=00, name=chipdev]{Final Review}{2024-05-20}{2024-06-14} \\
        \ganttlinkedbar[progress=00, name=chipanal]{Presentation and Submission}{2024-06-17}{2024-06-21} \\
        \ganttset{progress label text={}}
        \ganttlink[]{koflr2}{oeclone}
        \ganttlink[]{oeclone}{themA}

        \ganttlink[]{rnaanal}{chipgrow}

    \end{ganttchart}
\end{sideways}

\end{document}

在此处输入图片描述

相关内容