I recreated everything from scratch and made it a \pic
that is highly customizable and allows for 24-hours or am/pm format. It uses the calendar
library which should make it easy to create a full calendar made of these \pic
s:
\documentclass[border=10pt, tikz]{standalone}
\usetikzlibrary{calendar}
\newcount\chronodexcurrentdate
\newcount\chronodexcurrentweekday
\tikzset{
pics/chronodex/.style={
code={
\tikzset{chronodex/.cd, #1}
% inner segments
\fill[chronodex/segment 6 to 7 am]
(270:3) arc[start angle=270, end angle=240, radius=3] --
(240:2) arc[start angle=240, end angle=270, radius=2] -- cycle;
\fill[chronodex/segment 7 to 8 am]
(240:3) arc[start angle=240, end angle=210, radius=3] --
(210:2) arc[start angle=210, end angle=240, radius=2] -- cycle;
\fill[chronodex/segment 8 to 9 am]
(210:3) arc[start angle=210, end angle=180, radius=3] --
(180:2) arc[start angle=180, end angle=210, radius=2] -- cycle;
\draw[chronodex/inner ring]
(90:2) arc[start angle=90, end angle=-180, radius=2];
\foreach \i [count=\a from 0] in {90,60,...,-180} {
\draw[chronodex/inner line]
(\i:3) -- (\i:2);
\pgfmathparse{int(\a > 0 && \a < 7 ? 1 : 0)}
\ifnum\pgfmathresult=1\relax
\node[rotate={\i}, anchor=south east, chronodex/inner label]
at (\i:3) {\a\pgfkeysvalueof{/tikz/chronodex/am suffix}};
\fi
\pgfmathparse{int(\a > 6 && \a < 9 ? 1 : 0)}
\ifnum\pgfmathresult=1\relax
\node[rotate={\i-180}, anchor=south west, chronodex/inner label]
at (\i:3) {\a\pgfkeysvalueof{/tikz/chronodex/am suffix}};
\fi
}
% outer segments
\fill[chronodex/segment 9 to 10 pm]
(180:7) arc[start angle=180, end angle=150, radius=7] --
(150:6) arc[start angle=150, end angle=180, radius=6] -- cycle;
\fill[chronodex/segment 10 to 11 pm]
(150:7) arc[start angle=150, end angle=120, radius=7] --
(120:6) arc[start angle=120, end angle=150, radius=6] -- cycle;
\fill[chronodex/segment 11 pm to 12 am]
(120:7) arc[start angle=120, end angle=90, radius=7] --
(90:6) arc[start angle=90, end angle=120, radius=6] -- cycle;
\draw[chronodex/outer ring]
(180:7) arc[start angle=180, end angle=90, radius=7]
(90:6) arc[start angle=90, end angle=180, radius=6];
\foreach \o [count=\p from 0] in {180,150,...,90} {
\draw[chronodex/outer line]
(\o:7) -- (\o:6);
\ifnum\p<3\relax
\pgfmathsetmacro{\h}{int(\p+9+\pgfkeysvalueof{/tikz/chronodex/24 hours conversion})}
\node[rotate={\o-180}, anchor=south west, chronodex/outer label]
at (\o:7) {\h\pgfkeysvalueof{/tikz/chronodex/pm suffix}};
\fi
}
% base segments
\foreach \b [count=\a from 0] in {180,90,...,-90} {
\draw[chronodex/additional ring]
(\b:5) arc[start angle={\b}, end angle={\b-30}, radius=5]
(\b:6) arc[start angle={\b}, end angle={\b-60}, radius=6]
({\b-30}:5) -- ({\b-30}:6);
\fill[chronodex/base segments]
(\b:4) arc[start angle={\b}, end angle={\b-30}, radius=4] --
({\b-30}:5) arc[start angle={\b-30}, end angle={\b-60}, radius=5] --
({\b-60}:6) arc[start angle={\b-60}, end angle={\b-90}, radius=6] --
({\b-90}:3) arc[start angle={\b-90}, end angle={\b}, radius=3] -- (\b:3) -- cycle;
\draw[chronodex/primary ring]
(\b:3) -- (\b:4)
arc[start angle={\b}, end angle={\b-30}, radius=4] -- ({\b-30}:3);
\draw[chronodex/primary ring]
({\b-30}:3) -- ({\b-30}:5)
arc[start angle={\b-30}, end angle={\b-60}, radius=5] -- ({\b-60}:3);
\draw[chronodex/secondary ring]
({\b-30}:4) arc[start angle={\b-30}, end angle={\b-60}, radius=4];
\draw[chronodex/primary ring]
({\b-60}:3) -- ({\b-60}:6)
arc[start angle={\b-60}, end angle={\b-90}, radius=6] -- ({\b-90}:3);
\draw[chronodex/secondary ring]
({\b-60}:4) arc[start angle={\b-60}, end angle={\b-90}, radius=4]
({\b-60}:5) arc[start angle={\b-60}, end angle={\b-90}, radius=5];
\foreach \n in {7.5,15,22.5} {
\foreach \t/\a in {4/0, 5/30, 6/60} {
\tikzset{chronodex/tick bottom start={3}}
\draw[rotate={\b-\a-\n}, chronodex/primary tick]
\pgfkeysvalueof{/tikz/chronodex/tick bottom code};
\tikzset{chronodex/tick top start={\t}}
\draw[rotate={\b-\a-\n}, chronodex/primary tick]
\pgfkeysvalueof{/tikz/chronodex/tick top code};
}
\tikzset{chronodex/tick middle start={4}}
\draw[rotate={\b-30-\n}, chronodex/secondary tick]
\pgfkeysvalueof{/tikz/chronodex/tick middle code};
\draw[rotate={\b-60-\n}, chronodex/secondary tick]
\pgfkeysvalueof{/tikz/chronodex/tick middle code};
\tikzset{chronodex/tick middle start={5}}
\draw[rotate={\b-60-\n}, chronodex/secondary tick]
\pgfkeysvalueof{/tikz/chronodex/tick middle code};
}
\ifnum\a=0\relax
\node[rotate={\b-180}, anchor=south west, chronodex/base label]
at (\b:4) {9\pgfkeysvalueof{/tikz/chronodex/am suffix}};
\node[rotate={\b-210}, anchor=south west, chronodex/base label]
at ({\b-30}:5) {10\pgfkeysvalueof{/tikz/chronodex/am suffix}};
\node[rotate={\b-240}, anchor=south west, chronodex/base label]
at ({\b-60}:6) {11\pgfkeysvalueof{/tikz/chronodex/am suffix}};
\node[rotate={\b-270}, anchor=south west, chronodex/base label]
at ({\b-90}:6) {12\pgfkeysvalueof{/tikz/chronodex/noon suffix}};
\else
\ifnum\a=3\relax
\pgfmathsetmacro{\h}{int(\a*3-2+\pgfkeysvalueof{/tikz/chronodex/24 hours conversion})}
\node[rotate={\b-210}, anchor=south west, chronodex/base label]
at ({\b-30}:5) {\h\pgfkeysvalueof{/tikz/chronodex/pm suffix}};
\pgfmathsetmacro{\h}{int(\a*3-1+\pgfkeysvalueof{/tikz/chronodex/24 hours conversion})}
\node[rotate={\b-240}, anchor=south west, chronodex/base label]
at ({\b-60}:6) {\h\pgfkeysvalueof{/tikz/chronodex/pm suffix}};
\else
\pgfmathsetmacro{\h}{int(\a*3-2+\pgfkeysvalueof{/tikz/chronodex/24 hours conversion})}
\node[rotate={\b-30}, anchor=south east, chronodex/base label]
at ({\b-30}:4) {\h\pgfkeysvalueof{/tikz/chronodex/pm suffix}};
\pgfmathsetmacro{\h}{int(\a*3-1+\pgfkeysvalueof{/tikz/chronodex/24 hours conversion})}
\node[rotate={\b-60}, anchor=south east, chronodex/base label]
at ({\b-60}:5) {\h\pgfkeysvalueof{/tikz/chronodex/pm suffix}};
\pgfmathsetmacro{\h}{int(\a*3+\pgfkeysvalueof{/tikz/chronodex/24 hours conversion})}
\node[rotate={\b-90}, anchor=south east, chronodex/base label]
at ({\b-90}:6) {\h\pgfkeysvalueof{/tikz/chronodex/pm suffix}};
\fi
\fi
}
\draw[chronodex/base ring]
(0:0) circle[radius=3];
% day and weekday
\ifdefined\chronodexcurrentday
\pgfmathtruncatemacro{\d}{\chronodexcurrentday.0}
\node[chronodex/day]
at (0,0) {\d};
\node[chronodex/weekday]
at (0,0) {\pgfcalendarweekdayname{\chronodexcurrentweekday}};
\fi
}
},
chronodex/date/.code={
\pgfcalendardatetojulian{#1}{\chronodexcurrentdate}
\pgfcalendarjuliantodate{\chronodexcurrentdate}{\chronodexcurrentyear}{\chronodexcurrentmonth}{\chronodexcurrentday}
\pgfcalendarjuliantoweekday{\chronodexcurrentdate}{\chronodexcurrentweekday}
},
chronodex/date/.initial={},
chronodex/am suffix/.initial={\,am},
chronodex/pm suffix/.initial={\,pm},
chronodex/noon suffix/.initial={\,noon},
chronodex/24 hours conversion/.initial={0},
chronodex/24 hours/.style={
am suffix={:00},
pm suffix={:00},
noon suffix={:00},
24 hours conversion={12},
},
chronodex/minor tick length/.initial={5},
chronodex/major tick length/.initial={7},
chronodex/tick top start/.initial={0},
chronodex/tick middle start/.initial={0},
chronodex/tick bottom start/.initial={0},
chronodex/tick top code/.initial={
(0:\pgfkeysvalueof{/tikz/chronodex/tick top start}) --
++(0:{(\n == 15 ? \pgfkeysvalueof{/tikz/chronodex/major tick length} : \pgfkeysvalueof{/tikz/chronodex/minor tick length})*-1pt})
},
chronodex/tick middle code/.initial={
([shift={(0:{(\n == 15 ? \pgfkeysvalueof{/tikz/chronodex/major tick length} : \pgfkeysvalueof{/tikz/chronodex/minor tick length})*-0.5pt})}]0:\pgfkeysvalueof{/tikz/chronodex/tick middle start}) --
++(0:{(\n == 15 ? \pgfkeysvalueof{/tikz/chronodex/major tick length} : \pgfkeysvalueof{/tikz/chronodex/minor tick length})*1pt})
},
chronodex/tick bottom code/.initial={
(0:\pgfkeysvalueof{/tikz/chronodex/tick bottom start}) --
++(0:{(\n == 15 ? \pgfkeysvalueof{/tikz/chronodex/major tick length} : \pgfkeysvalueof{/tikz/chronodex/minor tick length})*1pt})
},
chronodex/base ring/.style={
thick,
},
chronodex/base segments/.style={
white!0,
},
chronodex/primary ring/.style={
thick,
},
chronodex/primary tick/.style={
},
chronodex/secondary ring/.style={
gray,
},
chronodex/secondary tick/.style={
},
chronodex/inner ring/.style={
gray,
densely dashed,
},
chronodex/inner line/.style={
gray,
},
chronodex/outer ring/.style={
gray,
densely dashed,
},
chronodex/additional ring/.style={
gray,
densely dotted,
},
chronodex/outer line/.style={
gray,
},
chronodex/label/.style={
font=\footnotesize,
},
chronodex/base label/.style={
chronodex/label,
},
chronodex/inner label/.style={
chronodex/label,
gray,
},
chronodex/outer label/.style={
chronodex/label,
gray,
},
chronodex/segment 6 to 7 am/.style={
gray!25,
},
chronodex/segment 7 to 8 am/.style={
gray!15,
},
chronodex/segment 8 to 9 am/.style={
gray!5,
},
chronodex/segment 9 to 10 pm/.style={
white!0,
},
chronodex/segment 10 to 11 pm/.style={
white!0,
},
chronodex/segment 11 pm to 12 am/.style={
white!0,
},
chronodex/day/.style={
anchor=south,
font=\Huge,
},
chronodex/weekday/.style={
anchor=north,
font=\large,
},
}
\begin{document}
\begin{tikzpicture}
\pic {chronodex};
\end{tikzpicture}
\begin{tikzpicture}
\pic {chronodex={date=2023-06-08}};
\end{tikzpicture}
\begin{tikzpicture}
\pic {chronodex={24 hours,
tick middle code={
(0:\pgfkeysvalueof{/tikz/chronodex/tick middle start}) node[circle, inner sep=1.25pt, fill=cyan] {}
},
base ring/.append style={cyan, very thick},
base segments/.append style={cyan!10},
primary ring/.append style={cyan, thick},
primary tick/.append style={magenta!50},
secondary tick/.append style={cyan},
segment 6 to 7 am/.append style={magenta!25},
segment 7 to 8 am/.append style={magenta!15},
segment 8 to 9 am/.append style={magenta!5},
segment 9 to 10 pm/.append style={magenta!25},
segment 10 to 11 pm/.append style={magenta!15},
segment 11 pm to 12 am/.append style={magenta!5},
label/.append style={magenta, font=\sffamily}}};
\end{tikzpicture}
\end{document}