This is my MWE (not that Minimum, I know):
\documentclass{article}
\usepackage{tikz}
\definecolorseries{colorser}{rgb}{last}{blue}{green}
\def\piechart#1#2#3#4#5{%1:data,2:numberOfElements,3:colors,4:outerRadius,5:labels
\resetcolorseries[#2]{#3}
\edef\startangle{90}
\foreach [
remember=\endangle as \startangle,
evaluate=\i as \endangle using {\startangle-(\csname#1\endcsname[\i-1]/100*360)},
evaluate=\halfangle using {(\endangle-\startangle)/2+\startangle},
] \i in {1,...,#2} {%
\fill[{#3!![\i]}] (0,0) --++(\startangle:#4) arc (\startangle:\endangle:#4);
\draw[white, line width=0.75mm](0,0)--++(\startangle:#4+0.1pt);
% \node at (\halfangle:#4) {\pgfmathparse{#5[\i]}\pgfmathresult};% Error: "Package PGF Math Error: Unknown function.."
\node at (\halfangle:#4) {\csname#5\endcsname[\i]};
}
\draw[white,line width=0.75mm](0,0)--++(\startangle:#4);
\fill[white](0,0)circle [radius=#4*0.4];%
}
\begin{document}
\begin{tikzpicture}
\newcommand\shares{{50,30,15,5}}
\newcommand\labels{{"a","b","c","d"}}
\piechart{shares}{4}{colorser}{2cm}{labels}
\end{tikzpicture}
\end{document}
I'm still trying to bring labels to my pie chart. This is what it's looking like at the moment:

As you probably guess, I want the labels to be:
- a at the blue part
- ...
- d at the green part
I also tried the line I commented out in the MWE, but that results in the error:
Package PGF Math Error: Unknown function `labels' (in 'labels[1]').
I first thought the string list would be the problem, but since my linked question didn't help me, I'm again clueless. Thanks for the help again!!
