I am trying to draw a pie chart from a csv file using pgf-pie. And it must be pdf-pie, because datapie does not work for me under Debian 11. It did work under Debian 10. So I'm trying pgf-pie and I'm not interested in other solutions with other packages.
\documentclass{article}
\usepackage{csvsimple}
\usepackage{pgf-pie}
\begin{document}
\begin{filecontents*}{fruit.csv}
Name,Quantity
"Apples",30
"Pears",25
"Lemons,Limes",40.5
"Peaches",34.5
"Cherries",20
\end{filecontents*}
\csvreader[]{fruit.csv}{Name = \Name, Quantity = \Quantity}{\Quantity/\Name,}
\begin{tikzpicture}
\pie[polar, explode=0.1]{
\csvreader[]{fruit.csv}{Name = \Name, Quantity = \Quantity}{\Quantity/\Name,}
}
\end{tikzpicture}
\end{document}
The first \csvreader prints
30/”Apples”,25/”Pears”,34.5/”Peaches”,20/”Cherries”,
But that is wrong, because it doesn't print 40.5/"Lemons,Limes".
And the second \csvreader hangs pdflatex for ever with this error message:
! Use of \csv@reader doesn't match its definition.
\@ifnextchar ...eserved@d =#1\def \reserved@a {#2}
\def \reserved@b {#3}\futu...
l.2091 }
Why does this not work?