包含 Q1/Q2/Q3/Q4 的甘特图

包含 Q1/Q2/Q3/Q4 的甘特图

我正在努力用甘特图将月份替换为季度(以获得更紧凑的视图)。这个问题之前在这里问过,但我找不到合适的答案。有什么想法吗?

第二点是我想添加在文本其他地方明确说明的“里程碑”(如 M1、M2..)(M1 = 第一个成就)

谢谢

\documentclass[a4]{article}
\usepackage{pgfgantt}
\usepackage{tikz}   
\begin{document}
\newcommand\ganttbarbis[5]{\ganttbar{#1}{#3}{#4}\ganttbar[inline, bar/.append style={fill=#5},bar label font=\footnotesize]{#2}{#3}{#4}}
\noindent\resizebox{\textwidth}{!}{
\begin{ganttchart}[time slot format=isodate-yearmonth, 
vgrid={dotted,draw=none,draw=none}, %hgrid=true, 
x unit=0.45cm,  % NOTE: width for a single month
y unit chart = 0.6cm, bar height=0.6,
y unit title = 0.5cm, title height=1,
include title in canvas=false,
time slot unit=month
]{2023-09}{2025-10}  
% temporal marks
\gantttitlecalendar[title/.style={fill=black!30,draw=black}]{year} \\
\gantttitlecalendar[title/.style={fill=black!20,draw=black}]{month} \\
% horizontal bars
\ganttbarbis{WP~0}{Project coordination}{2023-10}{2025-09}{blue!50} \\
\ganttbarbis{WP~1}{WP1 #1}{2023-10}{2025-02}{red!50} \\
\ganttbarbis{WP~2}{WP2 #2}{2025-01}{2025-06}{red!25} \\   
% not a very nice Milestone - how to add explanations of M1?
\ganttmilestone{M1}{2024-10}\\
\end{ganttchart}
}
\end{document}

相关内容