3

I don't know why my program is not running ok and the error message is this :

paragraph ended before \pgffor@next was complete

Every idea helps thx!!!

This is the code:

% Pie chart with colors
% Author: Henri Menke
\documentclass[tikz,border=10pt]{standalone}
\begin{document}
\def\angle{0}
\def\radius{4.8}
\def\cyclelist{{"orange","blue","red","green","magenta","yellow","cyan","purple",}}
\newcount\cyclecount \cyclecount=-1
\newcount\ind \ind=-1


\begin{tikzpicture}
 [nodes = {font=\sffamily}]
  \foreach \percent/\name in {
      12.5/Segmento1,
      12.5/Segmento2,
      12.5/Segmento3,
      12.5/Segmento4,
      12.5/Segmento5,
      12.5/Segmento6,
      12.5/Segmento7,
      12.5/Segmento8
   }
  \foreach \percentSIS in {
      9.57,
      8.54,
      7.81,
      4.62,
      5.58,
      3.49,
      8.36,
      7.53
   }

   {
     \ifx\percent\empty\else               % If \percent is empty, do nothing
       \global\advance\cyclecount by 1     % Advance cyclecount
       \global\advance\ind by 1            % Advance list index
        \ifnum7<\cyclecount                 % If cyclecount is larger than list
          \global\cyclecount=0              %   reset cyclecount and
         \global\ind=0                     %   reset list index
        \fi
       \pgfmathparse{\cyclelist[\the\ind]} % Get color from cycle list
       \edef\color{\pgfmathresult}         %   and store as \color
        % Draw angle and set labels
       \draw[fill={\color!50},draw={\color}] (0,0) -- (\angle:\radius)
         arc (\angle:\angle+\percent*3.6:\radius) -- cycle;
       \node at (\angle+0.5*\percent*3.6:0.85*\radius) {\percent\,\%};
       \node at (\angle+0.5*\percent*3.6:0.55*\radius) {\percentSIS\,\%};
       \node[pin=\angle+0.5*\percent*3.6:\name]
         at (\angle+0.5*\percent*3.6:\radius) {};
       \pgfmathparse{\angle+\percent*3.6}  % Advance angle
       \xdef\angle{\pgfmathresult}         %   and store in \angle
     \fi
   };



  \node[align=center,text width=3cm]{WWS};


  \draw[gray] (0,0) circle (3.5cm) circle (2cm);

\end{tikzpicture}
\end{document} 
4

The error message is reported as being on line 34, which is a blank line (end of paragraph) removing the blank line makes the error go.

| improve this answer | |

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.