How to create dotted counter?
For fun, here is how to implement this using the visualcounter
module in ConTeXt (Full disclosure: I am the author of the module).
\usemodule[visualcounter]
\definepalet
[ratings]
[
active=black,
past=black,
future=gray,
]
\definevisualcounter
[ratings]
[markers]
[
last=8,
palette=ratings,
]
\starttext
\starttabulate[|l|l|]
\NC Adobe Photoshop \NC \usevisualcounter[n=7]{ratings} \NC \NR
\NC Adobe Illustrator \NC \usevisualcounter[n=8]{ratings} \NC \NR
\NC Adobe Indesign \NC \usevisualcounter[n=7]{ratings} \NC \NR
\stoptabulate
\stoptext
which gives
A very elementary style with tikz
, not too sophisticated.
\documentclass{article}
\newcounter{numofdots}
\usepackage{tikz}
\def\myscale{0.5}
\begin{document}
\begin{description}
\item[Adobe Photoshop]\hfill
\begin{tikzpicture}
\setcounter{numofdots}{7}
\foreach \x in {1,...,8} {%
\ifnum \x > \value{numofdots}
\draw[fill=gray,gray] (\x*\myscale,-1) circle (0.1cm);
\else
\draw[fill=black] (\x*\myscale,-1) circle (0.1cm);
\fi
}
\end{tikzpicture}
\item[Adobe Illustrator]\hfill
\begin{tikzpicture}
\setcounter{numofdots}{8}
\foreach \x in {1,...,8} {%
\ifnum \x > \value{numofdots}
\draw[fill=gray,gray] (\x*\myscale,-1) circle (0.1cm);
\else
\draw[fill=black] (\x*\myscale,-1) circle (0.1cm);
\fi
}
\end{tikzpicture}
\item[Adobe Indesign]\hfill
\begin{tikzpicture}
\setcounter{numofdots}{7}
\foreach \x in {1,...,8} {%
\ifnum \x > \value{numofdots}
\draw[fill=gray,gray] (\x*\myscale,-1) circle (0.1cm);
\else
\draw[fill=black] (\x*\myscale,-1) circle (0.1cm);
\fi
}
\end{tikzpicture}
\end{description}
\end{document}
Update
Something easier
to use:
\documentclass{article}
\newcounter{numofdots}
\newcommand{\showdots}[3][gray]{%
\begin{tikzpicture}
\foreach \x in {1,...,#2} {%
\ifnum \x > #3
\draw[fill=#1,#1] (\x*\myscale,-1) circle (0.1cm);
\else
\draw[fill=black] (\x*\myscale,-1) circle (0.1cm);
\fi
}
\end{tikzpicture}%
}
\usepackage{tikz}
\def\myscale{0.5}
\begin{document}
\begin{tabular}{ll}
Adobe Photoshop & \showdots{8}{7}\tabularnewline
Adobe Illustrator &\showdots{8}{8}\tabularnewline
Adobe Indesign & \showdots[red]{8}{7} \tabularnewline
\LaTeXe & \showdots[gray]{15}{15} \tabularnewline
Word & \showdots[gray]{15}{0} \tabularnewline
\end{tabular}
\end{document}
Update again -- Just using a plain
loop and not Ti*k*Z
\documentclass{article}
\usepackage{xcolor}
\newcounter{numofdots}
\newcommand{\showdots}[3][gray]{%
\setcounter{numofdots}{0}
\loop\unless\ifnum\value{numofdots} = #2
\stepcounter{numofdots}%
\ifnum\value{numofdots} > #3
{\color{#1}\textbullet\hskip0.5em}%
\else
\textbullet\hskip0.5em%
\fi
\repeat%
\hfill
}
\def\myscale{0.5}
\begin{document}
\begin{tabular}{ll}
Adobe Photoshop & \showdots{8}{7}\tabularnewline
Adobe Illustrator &\showdots{8}{8}\tabularnewline
Adobe Indesign & \showdots[red]{8}{7} \tabularnewline
\LaTeXe & \showdots[gray]{15}{15} \tabularnewline
Word & \showdots[gray]{15}{0} \tabularnewline
\end{tabular}
\end{document}
Something like this?
\documentclass[tikz,multi,border=10pt]{standalone}
\begin{document}
\begin{tikzpicture}
\path (0,0) foreach \i in {fill,fill,fill,fill,fill,fill,fill,} {++(.5,0) node [circle, draw, \i] {}};
\end{tikzpicture}
\end{document}