pgfgantt 条形对齐关闭

pgfgantt 条形对齐关闭

在此处输入图片描述

由于某种原因它看起来像这样,这里是代码:

    \begin{landscape}
    \begin{ganttchart}{28}{28}
    \gantttitle{2012}{12}
    \gantttitle{2013}{16} \\
    \gantttitle{October}{4}
    \gantttitle{November}{4}
    \gantttitle{December}{4}
    \gantttitle{January}{4}
    \gantttitle{February}{4}
    \gantttitle{March}{4}
    \gantttitle{April}{4} \\
    \ganttbar{Study previous code}{3}{12} \\
    \ganttbar{Writing 1st rep.}{3}{4} 
    \ganttmilestone{}{4}\\
    \ganttbar{Writing 2nd rep.}{5}{7} 
    \ganttmilestone{}{7}\\
    \ganttbar{Writing research rep.}{6}{9} 
    \ganttmilestone{}{9}\\
    \ganttbar{Desktop application}{7}{12} \\
    \ganttbar{Tablet application}{10}{15} \\
    \ganttbar{Connecting applications}{9}{19} \\
    \ganttbar{Writing 3rd rep.}{18}{20} 
    \ganttmilestone{}{20}\\
    \ganttbar{Data analysis tools}{19}{25} \\
    \ganttbar{Writing final report}{20}{28} 
    \ganttmilestone{}{28}\\
    \ganttbar{Writing 4th rep.}{21}{23} 
    \ganttmilestone{}{23}\\
    \end{ganttchart}
    \end{landscape}

这是图表页面上的唯一代码。我也在 ShareLatex 上启动了一个新项目,它做了同样的事情。

答案1

这是一个通过 <--- 显示更改的解决方案。此外,此解决方案使用landscape来自geometry

在此处输入图片描述

代码

\documentclass[]{article}
\usepackage{pgfgantt}
%\usepackage{pdflscape}
\usepackage[a4paper,margin=1in,landscape]{geometry}
\begin{document}
%    \begin{landscape}
    \begin{ganttchart}[vgrid, hgrid]{1}{28}  % <---
    \gantttitle{2012}{12}
    \gantttitle{2013}{16} \\
    \gantttitle{October}{4}
    \gantttitle{November}{4}
    \gantttitle{December}{4}
    \gantttitle{January}{4}
    \gantttitle{February}{4}
    \gantttitle{March}{4}
    \gantttitle{April}{4} \\
    \ganttbar{Study previous code}{3}{12} \\
    \ganttbar{Writing 1st rep.}{3}{4} 
    \ganttmilestone{}{4}\\
    \ganttbar{Writing 2nd rep.}{5}{7} 
    \ganttmilestone{}{7}\\
    \ganttbar{Writing research rep.}{6}{9} 
    \ganttmilestone{}{9}\\
    \ganttbar{Desktop application}{7}{12} \\
    \ganttbar{Tablet application}{10}{15} \\
    \ganttbar{Connecting applications}{9}{19} \\
    \ganttbar{Writing 3rd rep.}{18}{20} 
    \ganttmilestone{}{20}\\
    \ganttbar{Data analysis tools}{19}{25} \\
    \ganttbar{Writing final report}{20}{28} 
    \ganttmilestone{}{28}\\
    \ganttbar{Writing 4th rep.}{21}{23} 
    \ganttmilestone{}{23}\\
    \end{ganttchart}
%    \end{landscape}
\end{document}

相关内容