我的甘特图有问题。它看起来很挤,因为我以周为单位指定时间范围,但它们以天为单位显示。因此,里程碑矩形看起来很奇怪。
我已经尝试设置time slot unit
为week
,但不幸的是这个键不可用。
我有什么选择?
\documentclass{article}
\usepackage[utf8]{inputenc}
\usepackage{pgfgantt}
\begin{document}
\section{MWE}
\begin{ganttchart}[
hgrid,
vgrid={*{6}{draw=none}, dotted},
x unit=0.125cm,
time slot format=isodate,
time slot unit=day,
calendar week text = {W\currentweek{}}
]{2019-02-04}{2019-05-19}
\gantttitlecalendar{year, month=name, week} \\
\ganttgroup{Proposal}{2019-02-04}{2019-02-24} \\
\ganttbar{Proposal Submits}{2019-02-04}{2019-02-10}
\ganttlinkedbar{}{2019-02-18}{2019-02-24} \\
\ganttgroup{Implementation}{2019-02-11}{2019-03-03} \\
\ganttbar{Something}{2019-02-11}{2019-02-17} \\
\ganttlinkedbar{Else...}{2019-02-18}{2019-03-03} \\
\ganttlinkedmilestone{Milestone 1}{2019-03-03}
\end{ganttchart}
\end{document}
问题PGFGantt 按周压缩日历?似乎有关联,但我认为我实际上应用了该解决方案,但对我而言它并没有多大用处,因为我有太多框架导致问题。另一方面,我无法增加,x unit
因为图表不再适合页面。
答案1
可能正如pgfgantt
手册中所述(在第 2.7.3 节选项:图表元素定位),我们可以试着milestone left shift =<factor>, milestone right shift = <factor>
放松一下被挤压的表现形式。
\documentclass{standalone}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}[
hgrid,
vgrid={*{6}{draw=none}, dotted},
x unit=0.125cm,
time slot format=isodate,
% time slot unit=day,
calendar week text = {W\currentweek{}},
milestone left shift =-1,
milestone right shift =2
%%
]{2019-02-04}{2019-05-19}
\gantttitlecalendar{year, month=name, week} \\
\ganttgroup{Proposal}{2019-02-04}{2019-02-24} \\
\ganttbar{Proposal Submits}{2019-02-04}{2019-02-10}
\ganttlinkedbar{}{2019-02-18}{2019-02-24} \\
\ganttgroup{Implementation}{2019-02-11}{2019-03-03} \\
\ganttbar{Something}{2019-02-11}{2019-02-17} \\
\ganttlinkedbar{Else...}{2019-02-18}{2019-03-03} \\
\ganttlinkedmilestone{Milestone 1}{2019-03-03}
\end{ganttchart}
\end{document}
这将为您提供:
更新 1Jens 的精彩更新
\documentclass{standalone}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}[
hgrid,
vgrid={*{6}{draw=none}, dotted},
x unit=0.125cm,
time slot format=isodate,
% time slot unit=day,
calendar week text = {W\currentweek{}},
milestone left shift =-1,
milestone right shift =2,
chart element start border=right,
% Jens's nice update
link bulge = 1.3,
link/.style={-to, rounded corners = 3pt}
%%
]{2019-02-04}{2019-05-19}
\gantttitlecalendar{year, month=name, week} \\
\ganttgroup{Proposal}{2019-02-04}{2019-02-24} \\
\ganttbar{Proposal Submits}{2019-02-04}{2019-02-10}
\ganttlinkedbar{}{2019-02-18}{2019-02-24} \\
\ganttgroup{Implementation}{2019-02-11}{2019-03-03} \\
\ganttbar{Something}{2019-02-11}{2019-02-17} \\
\ganttlinkedbar{Else...}{2019-02-18}{2019-03-03} \\
\ganttlinkedmilestone{Milestone 1}{2019-03-03}
\end{ganttchart}
\end{document}
我们可以得到:
PS:我也相信条/组左/右移动可以产生这些平滑的链接(当然既不是凸起也不是圆角;-)
)。