[Tex/LaTex] How to change the line color in pie chart

pgf-pie

I want to change the line color of a pie chart in LaTeX so that the line color of the slices take the fill color.

Mini example:

\usepackage{pgf-pie} 
\begin{document}
\begin{tikzpicture}
\pie[color={red, blue, yellow, green},
     sum=auto, after number=,text=pin,
     every only number node/.style={text=black}]{10/A,20/B,30/C,10/D}
\end{tikzpicture}
\end{document}

This has a black line color. How can I change it to the fill color of the slice?

Best Answer

You have to define a style for the lines (e.g. lines/.style={draw=none}) and then set the style key in \pie to lines:

\documentclass[tikz,border=10pt]{standalone}
\usepackage{pgf-pie}
\begin{document}
\begin{tikzpicture}
\tikzset{
     lines/.style={draw=none},
}
\pie[color={red, blue, yellow, green},
     sum=auto, after number=,text=pin,
     every only number node/.style={text=black},
     style={lines}
    ]{10/A,20/B,30/C,10/D}
\end{tikzpicture}
\end{document}

Because of how the style key is handled internally, you have to define the lines style outside of the argument for \pie and you cannot put the style settings directly in the value of style.

Related Question