pattern
是否有可能以任何方式指定ganttbar
?以下
\begin{ganttchart}{1}{2}
\ganttbar[pattern=north west lines]{Some bar}{1}{2} \\
\end{ganttchart}
给出
! Package pgfkeys Error: I do not know the key '/pgfgantt/pattern' and I am goi
ng to ignore it. Perhaps you misspelled it.
显然它没有实现。还有其他方法可以实现吗?
答案1
您需要访问当前bar
的样式以及append
它的模式规范。
代码
\documentclass{standalone}
\usepackage{pgfgantt}
\begin{document}
\begin{ganttchart}{1}{5}
\ganttbar[bar/.append style={pattern=north west lines}]{Some bar}{1}{2} \\
\ganttbar{Another bar}{2}{5}
\end{ganttchart}
\end{document}