1

I have 15 departments in my organization and wish to get a tikz representation of them all thus I sector a circle into 15 wishing to label each department in each sector and units of each department under each sector. I now come up with this:

%https://tex.stackexchange.com/questions/508078/speedometer-as-a-symbol-into-awesomebox
\documentclass[border=1cm]{standalone}
\usepackage[dvipsnames]{xcolor}
\usepackage{newtxtext}
\usepackage{tikz}
\usetikzlibrary{decorations.text, fadings}
\tikzfading[name=fade out,
inner color=transparent!0,
outer color=transparent!5]

\tikzset{ figNode/.style={ path picture={ \node at (path picture bounding box.center) {#1};}} } \usepackage[OT2, OT1]{fontenc} \begin{document}

\begin{tikzpicture}[font=\large, main/.style = {draw, circle, text=black,  
        preaction={draw, ultra thick, transform canvas={yshift=-0.2ex}, path fading=fuzzy ring 100 percent, opacity=0.25}
}]

    \draw[draw=white, fill = Cyan!70!ForestGreen!40!,thin] (114:5cm)-- (114:10cm) arc (114:90:10) -- (90:5cm) arc (90:114:5);% 15
    \draw[draw=white, fill = Cyan!70!Magenta!40!,thin] (138:5cm)-- (138:10cm) arc (138:114:10) -- (114:5cm) arc (114:138:5);% 14
    \draw[draw=white, fill = Cyan!70!ForestGreen!40!,thin] (162:5cm)-- (162:10cm) arc (162:138:10) -- (138:5cm) arc (138:162:5);% 13
    \draw[draw=white, fill = Cyan!40!YellowOrange!70!,thin] (186:5cm)-- (186:10cm) arc (186:162:10) -- (162:5cm) arc (162:186:5);% 12
    \draw[draw=white, fill = Magenta!70!ForestGreen!40!,thin] (210:5cm)-- (210:10cm) arc (210:186:10) -- (186:5cm) arc (186:210:5);% 11
    \draw[draw=white, fill = Cyan!70!ForestGreen!40!,thin] (234:5cm)-- (234:10cm) arc (234:210:10) -- (210:5cm) arc (210:234:5);% 10
    \draw[draw=white, fill = Cyan!40!ForestGreen!70!,thin] (258:5cm)-- (258:10cm) arc (258:234:10) -- (234:5cm) arc (234:258:5);% 09
    \draw[draw=white, fill = Cyan!70!ForestGreen!40!,thin] (282:5cm)-- (282:10cm) arc (282:258:10) -- (258:5cm) arc (258:282:5);% 08
    \draw[draw=white, fill = Cyan!70!,thin] (306:5cm)-- (306:10cm) arc (306:282:10) -- (282:5cm) arc (282:306:5);% 07
    \draw[draw=white, fill = Cyan!30!,thin] (330:5cm)-- (330:10cm) arc (330:306:10) -- (306:5cm) arc (306:330:5);% 06
    \draw[draw=white, fill = Cyan!130!,thin] (354:5cm)-- (354:10cm) arc (354:330:10) -- (330:5cm) arc (330:354:5);% 05
    \draw[draw=white, fill = ForestGreen!30!,thin] (378:5cm)-- (378:10cm) arc (378:354:10) -- (354:5cm) arc (354:378:5);% 04
    \draw[draw=white, fill = Cyan!70!YellowOrange!30!,thin] (402:5cm)-- (402:10cm) arc (402:378:10) -- (378:5cm) arc (378:402:5);% 03
    \draw[draw=white, fill = Cyan!30!YellowOrange!70!,thin] (426:5cm)-- (426:10cm) arc (426:402:10) -- (402:5cm) arc (402:426:5);% 02
    \draw[draw=white, fill = Cyan!30!ForestGreen!30!YellowOrange!30!,thin] (450:5cm)-- (450:10cm) arc (450:426:10) -- (426:5cm) arc (426:450:5);% 01

    % outer circle
    %\draw[line width=0.5 mm] circle[radius=4 cm];
    % outer circle
    \draw[draw=white,fill = gray!10,thick] circle[radius = 4.8cm];
    % outer circle
    \draw[draw=white,fill = gray!40,thick] circle[radius = 4.3cm];
    % outer circle
    \draw[draw=white,fill = gray!10,thick] circle[radius = 4cm];


    %Label1
    \draw[decoration={text along path,
        text={|\bfseries\large|Unit AAAAAAAAAAAAAA},text align={center}, raise=0.2cm}, decorate] (90:4.2cm) arc (90:45:4.2) -- (45:4.2cm) arc (45:0:4.2) -- (0:4.2cm) arc (0:-45:4.2) -- (-45:4.2cm) arc (-45:-90:4.2); 
    %%Label2
    %\draw[decoration={text along path,
        %text={|\bfseries\large|Unit BBBBBBBBBBBBBB},text align={center}, raise=0.2cm}, decorate] (135:4.2cm) arc (135:180:4.2) -- (180:4.2cm) arc (180:0:4.2) -- (0:4.2cm) arc (0:180:4.2) -- (180:4.2cm) arc (180:135:4.2);



\end{tikzpicture}

\end{document}

Which produces this

What I want

I want the following

  1. I want to write Unit BBBBBBBBBBBBBBBBBB to face the opposite degree of Unit AAAAAAAAAAAAAAA
  2. I want to write Dept-A, dept-B ... dept-O along each sectors and unit-1 unit-2 under each department.

Just like this

EDIT

I have visited HERE and HERE but can not relate them to my situation.

EDIT AGAIN

The names of my departments are as follows: Goods, Gooder, Bike, Bikle, Albas sitea, Adnine Fry, Shirter, Albana tao, Orger tea, Blir shell, Omini HO2,Tidy, Admin, Account and Wages, Procurement. The units under each `department are not necessarily two, it could be one in some cases, some departments may not even have units while some may have more than two.

1 Answers1

3

Here is an attempt with a foreach loop. You can modify the position of the first sector changing the \Aorig value

\documentclass[border=1cm]{standalone}
\usepackage[dvipsnames]{xcolor}
\usepackage{newtxtext}
\usepackage{tikz}
\usetikzlibrary{decorations.text, fadings}
\tikzfading[name=fade out,
inner color=transparent!0,
outer color=transparent!5]

\tikzset{ figNode/.style={ path picture={ \node at (path picture bounding box.center) {#1};}} } \usepackage[OT2, OT1]{fontenc} \begin{document} \pgfmathsetmacro\Nsector{15} \pgfmathsetmacro\Asector{360/\Nsector} \pgfmathsetmacro\Aorig{30}

\begin{tikzpicture}[font=\large, main/.style = {draw, circle, text=black,
preaction={draw, ultra thick, transform canvas={yshift=-0.2ex}, path fading=fuzzy ring 100 percent, opacity=0.25} }] \foreach[count=\xi] \c in {Cyan!70!ForestGreen!40!, Cyan!70!Magenta!40!, Cyan!70!ForestGreen!40!, Cyan!40!YellowOrange!70!, Magenta!70!ForestGreen!40!, Cyan!70!ForestGreen!40!, Cyan!40!ForestGreen!70!, Cyan!70!ForestGreen!40!, Cyan!70!, Cyan!30!, Cyan!130!, ForestGreen!30!, Cyan!70!YellowOrange!30!, Cyan!30!YellowOrange!70!, Cyan!30!ForestGreen!30!YellowOrange!30!} {\draw[draw=white, fill = \c,thin] (\Aorig-\xi\Asector:5cm)-- (\Aorig-\xi\Asector:10cm) arc (\Aorig-\xi\Asector:\Aorig-\xi\Asector-\Asector:10) -- (\Aorig-\xi\Asector-\Asector:5cm) arc (\Aorig-\xi\Asector-\Asector:\Aorig-\xi\Asector:5); \draw[decoration={text along path, text={|\bfseries\large|{\parbox{4em}{\centering{\large\color{red} Dept \symbol{\numexpr64+\xi}}\ Unit1\ Unit 2}}},text align={center}, raise=-1.2cm}, decorate] (\Aorig-\xi\Asector:10cm) arc (\Aorig-\xi\Asector:\Aorig-\xi\Asector-\Asector:10); % or with \node [align=center] at (\Aorig-\xi\Asector-.5\Asector:6.5cm){Dept \symbol{\numexpr64+\xi}\ Unit 1\ Unit2}; } % inner circle \draw[draw=white,fill = gray!10,thick] circle[radius = 4.8cm]; \draw[draw=white,fill = gray!40,thick] circle[radius = 4.3cm]; \draw[draw=white,fill = gray!10,thick] circle[radius = 4cm];

%Label1
\draw[decoration={text along path, text={|\bfseries\large|Unit AAAAAAAAAAAAAA},text align={center}, raise=0.2cm}, decorate] (180:4.2cm) arc (180:0:4.2);
%%Label2
\draw[decoration={text along path, text={|\bfseries\large|Unit BBBBBBBBBBBBBB},text align={center}, raise=0.2cm}, decorate] (0:4.2cm) arc (0:-180:4.2);

\end{tikzpicture} \end{document}

enter image description here


Edit

To be sure having Unit BBBBB facing Unit AAAAA, you can use the following code

\pgfmathsetmacro\uAAAangle{90}
\coordinate (uAAA) at (\uAAAangle:4.2cm);
        \draw[decoration={text along path, text={|\bfseries\large|Unit AAAAAAAAAAAAAA},text align={center}, raise=0.2cm}, decorate] (uAAA) arc (\uAAAangle:\uAAAangle-180:4.2);
        %%Label2
        \draw[decoration={text along path, text={|\bfseries\large|Unit BBBBBBBBBBBBBB},text align={center}, raise=0.2cm}, decorate] (\uAAAangle-180:4.2cm) arc (\uAAAangle-180:\uAAAangle-360:4.2);

Edit 2

You can specify the units' name in the loop with extra parameters (I don't know if you need to change the department label):

\foreach[count=\xi] \c/\uI/\uII in {Cyan!70!ForestGreen!40!/U A 1/U A 2,
      Cyan!70!Magenta!40!/U B 1/U B 2,
      Cyan!70!ForestGreen!40!/U C 1/U C 2,
      Cyan!40!YellowOrange!70!/U D 1/U D 2,
      Magenta!70!ForestGreen!40!/U E 1/U E 2,
      Cyan!70!ForestGreen!40!/U F 1/U F 2,
      Cyan!40!ForestGreen!70!/U G 1/U G 2,
      Cyan!70!ForestGreen!40!/U H 1/U H 2,
      Cyan!70!/U I 1/U I 2,
      Cyan!30!/U J 1/U J 2,
      Cyan!130!/U K 1/U K 2,
      ForestGreen!30!/U L 1/U L 2,
      Cyan!70!YellowOrange!30!/U M 1/U M 2,
      Cyan!30!YellowOrange!70!/U N 1/U N 2,
      Cyan!30!ForestGreen!30!YellowOrange!30!/U O 1/U O 2}
    {\draw[draw=white, fill = \c,thin] (\Aorig-\xi*\Asector:5cm)-- (\Aorig-\xi*\Asector:10cm) arc (\Aorig-\xi*\Asector:\Aorig-\xi*\Asector-\Asector:10) -- (\Aorig-\xi*\Asector-\Asector:5cm) arc (\Aorig-\xi*\Asector-\Asector:\Aorig-\xi*\Asector:5);
      \draw[decoration={text along path,
        text={|\bfseries\large|{\parbox{4em}{\centering{\large\color{red} Dept \symbol{\numexpr64+\xi}}\\ \uI\\ \uII}}},text align={center}, raise=-1.2cm}, decorate] (\Aorig-\xi*\Asector:10cm) arc (\Aorig-\xi*\Asector:\Aorig-\xi*\Asector-\Asector:10);
      % or with
      \node [align=center] at (\Aorig-\xi*\Asector-.5*\Asector:6.5cm){Dept \symbol{\numexpr64+\xi}\\ \uI\\ \uII};
    }

Edit 3

Taking into account the previous edits and last OP wishes:

\documentclass[border=1cm]{standalone}
\usepackage[dvipsnames]{xcolor}
\usepackage{newtxtext}
\usepackage{tikz}
\usetikzlibrary{decorations.text, fadings}
\tikzfading[name=fade out,
inner color=transparent!0,
outer color=transparent!5]

\tikzset{ figNode/.style={ path picture={ \node at (path picture bounding box.center) {#1};}} } \usepackage[OT2, OT1]{fontenc} \begin{document} \pgfmathsetmacro\Nsector{15} \pgfmathsetmacro\Asector{360/\Nsector} \pgfmathsetmacro\Aorig{30}

\begin{tikzpicture}[font=\large, main/.style = {draw, circle, text=black,
preaction={draw, ultra thick, transform canvas={yshift=-0.2ex}, path fading=fuzzy ring 100 percent, opacity=0.25} }] \foreach[count=\xi] \dpt/\c/\uI in {% Goods/Cyan!70!ForestGreen!40!/U A 1\U A 2, Gooder/Cyan!70!Magenta!40!/U B 1, Bike/Cyan!70!ForestGreen!40!/, Bikle/Cyan!40!YellowOrange!70!/U D 1\U D 2, Albas sitea/Magenta!70!ForestGreen!40!/U E 1, Adnine Fry/Cyan!70!ForestGreen!40!/, Shirter/Cyan!40!ForestGreen!70!/U G 1\U G 2, Albana tao/Cyan!70!ForestGreen!40!/U H 1, Orger tea/Cyan!70!/, Blir shell/Cyan!30!/U J 1\U J 2, Omini HO2/Cyan!130!/U K 1, Tidy/ForestGreen!30!/, Admin/Cyan!70!YellowOrange!30!/U M 1\U M 2, Account and Wages/Cyan!30!YellowOrange!70!/U N 1, Procurement/Cyan!30!ForestGreen!30!YellowOrange!30!/} {\draw[draw=white, fill = \c,thin] (\Aorig-\xi\Asector:5cm)-- (\Aorig-\xi\Asector:10cm) arc (\Aorig-\xi\Asector:\Aorig-\xi\Asector-\Asector:10) -- (\Aorig-\xi\Asector-\Asector:5cm) arc (\Aorig-\xi\Asector-\Asector:\Aorig-\xi\Asector:5); \draw[decoration={text along path, text={|\bfseries\large|{\parbox{4em}{\centering{\large\color{red} \dpt}\ \uI}}},text align={center}, raise=-1.2cm}, decorate] (\Aorig-\xi\Asector:10cm) arc (\Aorig-\xi\Asector:\Aorig-\xi\Asector-\Asector:10); % or with \node [align=center] at (\Aorig-\xi\Asector-.5\Asector:6.5cm){\dpt\ \uI}; } % inner circle \draw[draw=white,fill = gray!10,thick] circle[radius = 4.8cm]; \draw[draw=white,fill = gray!40,thick] circle[radius = 4.3cm]; \draw[draw=white,fill = gray!10,thick] circle[radius = 4cm];

\pgfmathsetmacro\uAAAangle{90}
\coordinate (uAAA) at (\uAAAangle:4.2cm);
\draw[decoration={text along path, text={|\bfseries\large|Unit AAAAAAAAAAAAAA},text align={center}, raise=0.2cm}, decorate] (uAAA) arc (\uAAAangle:\uAAAangle-180:4.2);
%%Label2
\draw[decoration={text along path, text={|\bfseries\large|Unit BBBBBBBBBBBBBB},text align={center}, raise=0.2cm}, decorate] (\uAAAangle-180:4.2cm) arc (\uAAAangle-180:\uAAAangle-360:4.2);

\end{tikzpicture} \end{document}

enter image description here

NBur
  • 4,326
  • 10
  • 27
  • The so call department and units are unique I can't see where to edit them to what they are really. It seems like you have overuse foreach command – Daniel James Jun 10 '22 at 13:31
  • I tried to work with provided info! – NBur Jun 10 '22 at 14:07
  • @DanielJames, you find the department names in the list of the foreach statement. // If you prefer, you can expand the foreach loop manually into a series of statements. – MS-SPO Jun 10 '22 at 15:59