我想制作一种“类似 PPT”的规划,其中包含几行项目和几周的时间表。我设法构建的最接近的结果是(在 chatGPT 的帮助下)是这样的:
但是有很多默认值,你知道这是否存在模板吗?我使用了 tikz 而不是 pgfgantt,因为我想让它尽可能简单。
感谢您阅读本文并祝大家有愉快的一天 :)
\documentclass{article}
\usepackage{tikz}
\usepackage{changepage}
\usetikzlibrary{calc}
\definecolor{project1color}{RGB}{61,153,112}
\definecolor{project2color}{RGB}{231,76,60}
\definecolor{project3color}{RGB}{65,131,215}
\newcommand{\drawBar}[4]{ % Usage : \drawBar{X coord}{Y coord}{p1}{p 2}{p 3}
\fill[#3] (#1,#2) rectangle (#1+#4/3,#2+0.3);
\fill[#3!50!white] (#1+#4/3,#2) rectangle (#1+#4*2/3,#2+0.3);
\fill[#3!80!white] (#1+#4*2/3,#2) rectangle (#1+#4,#2+0.3);
}
\begin{document}
\begin{figure}
\centering
\begin{adjustwidth}{-2cm}{}
\begin{tikzpicture}[x=0.4cm,y=0.4cm]
% projects
\draw (-0.5,-1) -- (-0.5,3) node[above,midway,rotate=90] {project 1};
\draw (-0.5,4) -- (-0.5,8) node[above,midway,rotate=90] {project 2};
\draw (-0.5,9) -- (-0.5,13) node[above,midway,rotate=90] {project 3};
% Planning
\drawBar{0}{2}{project1color}{30}
\drawBar{0}{6}{project2color}{45}
\drawBar{0}{10}{project3color}{20}
% Dates
\foreach \w in {1,...,18} {
\node[anchor=north,rotate=45] at (\w*7-3.5,0) {\w};
\foreach \d/\j in {1/0,2/1,3/2} {
\node[anchor=north] at (\w*7-3+\j,-1) {};
}
}
\end{tikzpicture}
\end{adjustwidth}
\end{figure}
\end{document}