Asked
Active
Viewed 2,155 times
5
-
1What does this question have to do with TeX/LaTeX? – Henri Menke Jul 19 '18 at 00:02
-
5What do these numbers even mean? You have a nice personality 57% of the time? You know 57% of all languages in the world? – Jul 19 '18 at 08:48
-
1If you like an answer and it was helpful, please consider upvoting (by clicking on the arrows next to the score) and marking it as accepted answer (by clicking on the checkmark ✓). – Jul 19 '18 at 09:27
2 Answers
17
Here is the obligatory tikz solution, wrapped inside a custom itemize environment that is created with enumitem. The net result is that using the lines
\begin{achievements}
\item[57]\textbf{Personality}\\Leadership, innovation
\item[16]\textbf{Organisation}\\blah
\end{achievements}
you can produce:
Of course, you can customise the colours to your hearts content!
Here's the full code:
\documentclass[svgnames]{article}
\usepackage{tikz}
\usetikzlibrary{calc}
\usepackage{siunitx}% only to force percentages to be integers
\usepackage{enumitem}
\let\realItem\item% save for later use
\newcommand\percentageItem[1][10]{%
\realItem[\smash{\tikz[baseline]{%
\node[minimum width=4em] at (0,0) {\num[round-mode=places,round-precision=0]{#1}\%};
\draw[thick,line width=1.5mm,Blue](90:5mm)
arc [radius=5mm, start angle=90, delta angle=-#1*3.6];
\draw[thick,line width=1.5mm,LightSteelBlue](90-#1*3.6:5mm)
arc [radius=5mm, start angle=90-#1*3.6, end angle=-270];
}}]%
}
\newlist{achievements}{itemize}{1}
\setlist[achievements]{
before=\let\item\percentageItem,%make \item = \percentageItem
leftmargin=*,
label={},
itemsep=3mm,
}
\begin{document}
\begin{achievements}
\item[57]\textbf{Personality}\\Leadership, innovation
\item[16]\textbf{Organisation}\\blah
\end{achievements}
\end{document}
8
With ConTeXt MKIV and MetaFun.
\noheaderandfooterlines
\startuseMPgraphic{circle}{percent}
interim linecap := butt;
pen thick;
thick := pencircle scaled 2pt ;
path p, q;
p := reverse (fullcircle scaled (2.5*BodyFontSize) rotated 90);
q := (p cutafter point (arctime \MPvar{percent}/100*(arclength p) of p) of p);
draw p withcolor \MPcolor{gray} withpen thick;
draw q withpen thick;
label("\MPvar{percent}\%", origin);
\stopuseMPgraphic
\setupxtable[skills][frame=off,columndistance=1em]
\setupxtable[skill:head][foregroundstyle=bold]
\setupxtable[skill:list][foregroundcolor=darkgray]
\starttext
\startxtable[skills]
\NC[ny=2] \useMPgraphic{circle}{percent=57} \NC[skill:head] Personality \NR
\NC[skill:list] Lazy \NR
\NC[ny=2] \useMPgraphic{circle}{percent=62} \NC[skill:head] Personality \NR
\NC[skill:list] Lazy \NR
\NC[ny=2] \useMPgraphic{circle}{percent=10} \NC[skill:head] Personality \NR
\NC[skill:list] Lazy \NR
\NC[ny=2] \useMPgraphic{circle}{percent=23} \NC[skill:head] Personality \NR
\NC[skill:list] Lazy \NR
\stopxtable
\stoptext
Henri Menke
- 109,596


