I copied a code from this post to make a sunburst chart, but I need to make 2 modifications that I haven't been able to work out:
is to add
%into the text, andis to create a joined legend for both pies in the figure.
When I tried to insert \% after the number in the following for example (\% is in bold)
\arctext[N1][firstgreen][15pt](1.5)(90)(-3.6){|\footnotesize\bf\color{white}| 1 26 **\%**};
the whole thing crashed.
If anybody could point out how I can make these 2 modifications that'd be super helpful.
\documentclass{article}
\usepackage{xcolor}
\definecolor{firstgreen}{HTML}{58D68D}
\definecolor{secondyellow}{HTML}{F4D03F}
\definecolor{thirdorange}{HTML}{F39C12}
\definecolor{purple1}{HTML}{D7BDE2}
\definecolor{purple2}{HTML}{BB8FCE}
\definecolor{purple3}{HTML}{A569BD}
\definecolor{purple4}{HTML}{884EA0}
\definecolor{root}{HTML}{B2B2B2}
\usepackage{tikz}
\usepackage{pgfmath}
\usetikzlibrary{decorations.text, arrows.meta,calc,shadows.blur,shadings}
\renewcommand*\familydefault{\sfdefault} % Set font to serif family
\def\arctext[#1][#2][#3](#4)(#5)(#6)#7{
\draw[
color=white,
thick,
line width=1.3pt,
fill=#2
]
(#5:#4cm+#3) coordinate (above #1) arc (#5:#6:#4cm+#3)
-- (#6:#4) coordinate (right #1) -- (#6:#4cm-#3) coordinate (below right #1)
arc (#6:#5:#4cm-#3) coordinate (below #1)
-- (#5:#4) coordinate (left #1) -- cycle;
\def\a#1{#4cm+#3}
\def\b#1{#4cm-#3}
\path[
decoration={
raise = -0.5ex, % Controls relavite text height position.
text along path,
text = {#7},
text align = center,
},
decorate
]
(#5:#4) arc (#5:#6:#4);
}
%arcarrow, this is mine, for beerware purpose...
%Function: Draw an arrow from arctex coordinate specific nodes to another
%Arrow start at the start of arctext box and could be shifted to change the position
%to avoid go over another box.
%Var: 1:Start coordinate 2:End coordinate 3:angle to shift from acrtext box
\def\arcarrow[#1](#2)(#3)[#4]{
\draw[thick,-,>=latex,color=#1,line width=1pt,shorten >=-2pt, shorten <=-2pt]
let \p1 = (#2), \p2 = (#3), % To access cartesian coordinates x, and y.
\n1 = {veclen(\x1,\y1)}, % Distance from the origin
\n2 = {veclen(\x2,\y2)}, % Distance from the origin
\n3 = {atan2(\y1,\x1)} % Angle where acrtext starts.
in (\n3-#4: \n1) -- (\n3-#4: \n2); % Draw the arrow.
}
\begin{document}
\begin{figure}[h]
\centering
\begin{tikzpicture}[
Center/.style ={
circle,
fill=white,
text=root,
align=center,
font =\footnotesize,
inner sep=1pt,
},
]
% Drawing the center
\node[Center](ROOT) at (0,0) {E};
% Drawing the Tex Arcs
% \Arctext[ID][box-style][box-height](radius)(start-angl)(end-angl){|text-styles| Text}
% Inner ring.
\arctext[N1][firstgreen][15pt](1.5)(90)(-3.6){|\footnotesize\bf\color{white}| 1 26};
\arctext[N2][secondyellow][10pt](1.5)(147.6)(356.4){|\footnotesize\bf\color{white}| 2 58};
\arctext[N3][thirdorange][15pt](1.5)(147.6)(90){|\footnotesize\bf\color{white}| 3 16};
% Outer ring
\arctext[N1S1][purple1][13pt](2.5)(90)(-3.6){|\footnotesize\bf\color{white}| Sub1};
\arctext[N2S4][purple4][13pt](2.5)(147.6)(356.4){|\footnotesize\bf\color{white}| Sub2};
\arctext[N3S1][purple1][13pt](2.5)(147.6)(90){|\footnotesize\bf\color{white}| Sub3};
\end{tikzpicture}
\hspace{2cm}
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
\begin{tikzpicture}[
Center/.style ={
circle,
fill=white,
text=root,
align=center,
font =\footnotesize,
inner sep=1pt,
},
]
% Drawing the center
\node[Center](ROOT) at (0,0) {V};
% Drawing the Tex Arcs
% \Arctext[ID][box-style][box-height](radius)(start-angl)(end-angl){|text-styles| Text}
% Inner ring.
\arctext[N1][firstgreen][10pt](1.5)(90)(-68.4){|\footnotesize\bf\color{white}| 1 44};
\arctext[N2][secondyellow][15pt](1.5)(194.4)(291.6){|\footnotesize\bf\color{white}| 2 27};
\arctext[N3][thirdorange][15pt](1.5)(194.4)(90){|\footnotesize\bf\color{white}| 3 29};
% Outer ring
% 1
\arctext[N1S1][purple1][13pt](2.5)(90)(-49.4){};
\arctext[N1S2][purple2][13pt](2.5)(310.6)(307.4){};
\arctext[N1S3][purple3][13pt](2.5)(307.4)(293.2){};
\arctext[N1S4][purple4][13pt](2.5)(293.2)(291.6){};
% 2
\arctext[N2S1][purple1][13pt](2.5)(291.6)(252.7){};
\arctext[N2S2][purple2][13pt](2.5)(252.7)(223.6){};
\arctext[N2S3][purple3][13pt](2.5)(223.6)(215.8){};
\arctext[N2S4][purple4][13pt](2.5)(215.8)(194.4){};
% 3
\arctext[N3S1][purple1][13pt](2.5)(194.4)(175.6){};
\arctext[N3S2][purple2][13pt](2.5)(175.6)(103.6){};
\arctext[N3S3][purple3][13pt](2.5)(103.6)(90){};
\end{tikzpicture}
\caption{CAPTION}
\label{fig:my_label}
\end{figure}
\end{document}

text={ {\%} }– John Kormylo Feb 19 '20 at 15:15