first version

This commit is contained in:
jankapunkt
2016-11-02 14:24:29 +01:00
parent 15bb2ac947
commit 8010f67ef1
9 changed files with 157 additions and 38564 deletions

View File

@ -44,7 +44,7 @@
\pgfmathparse{##3+##4+##5}
\let\perc\pgfmathresult
\pgfmathparse{#2*\perc/100}
\pgfmathparse{#2}
\let\barsize\pgfmathresult
\pgfmathparse{\barsize*##3/100}
@ -68,6 +68,6 @@
}
\begin{tikzpicture}
\setcounter{barcount}{0}
%\draw[draw=#3, line width= 2pt] (0,0) -- (#1,0);
}
{\end{tikzpicture}}

View File

@ -24,7 +24,7 @@
\newcommand{\bubble}[5]{
\definecolor{tmpcol}{RGB}{50,50,#5}
% slice
\filldraw[fill=tmpcol!100,draw=none] (#1,0.5) circle (#3);
\filldraw[fill=thirdcol,draw=none] (#1,0.5) circle (#3);
% outer label
\node[label=\textcolor{textcol}{#4}] at (#1,0.7) {};

View File

@ -0,0 +1,43 @@
%-----------------------------------------------------------------------------------------------------------------------------------------------%
% 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.
%
%-----------------------------------------------------------------------------------------------------------------------------------------------%
% draw a circle with facts
% param 1: fact text
% param 2: scale default=1 (scales only chart, not label text)
% param 3: big border color
% param 4: second border color
% param 5: label bg color
\newcommand{\factbubble}[5]{
\begin{tikzpicture}
\pgfmathparse{#2*2}
\let\pbxwidth\pgfmathresult
\filldraw[fill=#3,draw=none] (0,0) circle (#2 * 1.5);
\filldraw[fill=#5,draw=#4, line width=3.5pt] (0,0) circle (#2 * 1.2);
\node at (0,0) {
\parbox{\pbxwidth cm}{
\begin{center}
#1
\end{center}
}
};
\end{tikzpicture}
}

View File

@ -29,18 +29,18 @@
\foreach \p/\t in {#1} {
\setcounter{a}{\value{b}}
\addtocounter{b}{\p}
\addtocounter{c}{35}
\definecolor{currentcolor}{RGB}{50,50, 1\p}
\square{\thea/100*#2}{\theb/100*#2}{\p\%}{\t}{currentcolor}
\square{\thea/100*#2}{\theb/100*#2}{\p\%}{\t}{thirdcol}
}
\end{tikzpicture}
}
\newcommand{\square}[5] {
\pgfmathparse{#1+0.5*(#2-#1)-0.14}
\pgfmathparse{#1+0.5*(#2-#1)}
\let\midangle\pgfmathresult
\draw[draw=sectcol] (0.4, \midangle) -- (0.6,\midangle);
% slice
\filldraw[fill=#5!100,draw=bgcol!100, line width=3pt] (0,#1) -- (2,#1) -- (2,#2) -- (0,#2) -- cycle;
\filldraw[fill=#5!100,draw=bgcol!100, line width=3pt] (0,#1) -- (0.5,#1) -- (0.5,#2) -- (0,#2) -- cycle;
% outer label
\node[label=\textcolor{textcol}{#4}] at (1,\midangle) {};
\node[label=360:\colorbox{sectcol}{\textcolor{textcol}{#4}}] at (0.55,\midangle) {};
}