CV/infographics/g/bubbles.tex
2016-10-27 17:23:57 +02:00

44 lines
1.7 KiB
TeX

%-----------------------------------------------------------------------------------------------------------------------------------------------%
% The MIT License (MIT)
%
% Copyright (c) 2016 Jan Küster
%
% Permission is hereby granted, free of charge, to any person obtaining a copy
% of this software and associated documentation files (the "Software"), to deal
% in the Software without restriction, including without limitation the rights
% to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
% copies of the Software, and to permit persons to whom the Software is
% furnished to do so, subject to the following conditions:
%
% THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
% IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
% FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
% AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
% LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
% OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
% THE SOFTWARE.
%
%-----------------------------------------------------------------------------------------------------------------------------------------------%
\newcommand{\bubble}[5]{
\definecolor{tmpcol}{RGB}{50,50,#5}
% slice
\filldraw[fill=tmpcol!100,draw=none] (#1,0.5) circle (#3);
% outer label
\node[label=\textcolor{textcol}{#4}] at (#1,0.7) {};
}
\newcommand{\bubbles}[2]{
%reset counters
\setcounter{a}{0}
\setcounter{c}{150}
\begin{tikzpicture}[scale=3]
\foreach \p/\t in {#1} {
\addtocounter{a}{1}
\bubble{\thea/2}{\theb}{\p/25}{\t}{1\p0}
}
\end{tikzpicture}
}