3

With canvas/.append style we can customize the canvas lines or remove it as the code below.

canvas/.append style={fill=none, draw=none}

I would like to know how to remove only the Top and Right canvas lines.

1 Answer 1

3

Not exactly what you ask for, but to the same effect. Use draw=none in the canvas style, but add name=canvas in addition. You can then use the node anchors of that node to draw the left and bottom border, by placing the ganttchart environment inside a tikzpicture, and adding the appropriate \draw after \end{ganttchart}.

output of code

\documentclass[border=5mm]{standalone}
\usepackage{pgfgantt}
\begin{document}

\begin{tikzpicture}
\begin{ganttchart}[
canvas/.append style={
   fill=none,
   draw=none,
   name=canvas % node name for the canvas, used below
   }
]{1}{12}
\gantttitle{2011}{12} \\
\gantttitlelist{1,...,12}{1} \\
\ganttgroup{Group 1}{1}{7} \\
\ganttbar{Task 1}{1}{2} \\
\end{ganttchart}

% draw partial frame
\draw ([xshift=0.5\pgflinewidth]canvas.north west) |- ([yshift=0.5\pgflinewidth]canvas.south east);
\end{tikzpicture}
\end{document}
1

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.