I want to parameterize node creation in a foreach. The creation prozess was solved in: Cut part of radialshading out as node shape circular sector
I think the substitution in the foreach has a recognition problem, but otherwise, why get the first node what is expected, i.e. content (\monname) and the shading(rad1)?
Knows anyone a solution?
\documentclass[margin=100pt]{standalone}
\usepackage{tikz}
\makeatletter
% from https://tex.stackexchange.com/a/127045/121799
\tikzset{use path/.code=\tikz@addmode{\pgfsyssoftpath@setcurrentpath#1}}
\makeatother
\usetikzlibrary{calc,shapes.geometric,backgrounds,fadings}
\tikzset{my radial shader/.code args={#1 with radius #2}
{\pgfmathsetmacro{\rone}{0.6*#2}
\pgfmathsetmacro{\rtwo}{0.8*#2}
\typeout{#1:\rone,#2}
\pgfdeclareradialshading{#1}%shading name
{\pgfpoint{0}{0}}%center point pgfman301a,p.1083
{rgb(0pt)=(1.00,0.00,0.00); %color specification
rgb(\rone pt)=(0.60,1.00,0.00);
rgb(\rtwo pt)=(0.30,1.60,1.00);
rgb(#2)=(0.00,0.30,1.50) %extent of the circle
}%end color specification
}%end .code args
}%end tikzset
\begin{document}
\begin{tikzpicture}
\tikzset{shape circlesec/.style={
draw,
line width=1.1pt,
shape=circular sector,
circular sector angle=30,
shape border uses incircle,
anchor=sector center,%to get a circle!
minimum size = 6.6cm,%
}
}
\foreach \monname / \nodename / \borderrotate in {jan/"\jan"/90,feb/"\feb"/0,maerz/"\maerz"/-165} {%
\node [save path=\nodename, %this line must create "\jan","\feb" etc.
%\typeout{monname:\monname, nodename: \nodename}%doesn't work
% \node [save path=\jan,
style=shape circlesec,
shape border rotate=\borderrotate,
% shape border rotate=-165,
]%
(\monname) at (0,0) {\monname};%\nodename error undef ctrl seq
% (jan) at (0,0) {};%semicolon before \begin{scope} error
%
\begin{scope}[on background layer]
\path let \p1=($(\monname.arc center)-(\monname.sector center)$),
% \path let \p1=($(jan.arc center)-(jan.sector center)$),
\n1={veclen(\y1,\x1)} in
[my radial shader={rad1 with radius \n1}];%rad1==param1, \n1 param2 (radius \node \monat)
\clip[use path=\nodename];
% \clip[use path=\jan];
\pgfuseshading{rad1};
\end{scope}
}%end foreach
\end{tikzpicture}
\end{document}