I have three figures which I want to group together into one figure with subcaptions, because they have the same source:

I am using \subfloat for my other figures (got it from https://tex.stackexchange.com/a/246285/164280), which makes it look like this:

Whenever I try to use \subfloat for my custom wheelchart (from https://tex.stackexchange.com/a/436536/164280 and https://tex.stackexchange.com/a/18105/164280), TeXstudio says I'm missing brackets or have too many brackets. Either way it crashes. My code for the current output is:
\documentclass[11pt, twoside, a4paper]{report}
\usepackage[inner = 30mm, outer = 20mm, top = 30mm, bottom = 20mm, headheight = 13.6pt]{geometry}
\usepackage{emptypage}
\usepackage[toc,page]{appendix}
\usepackage{tikz}
\usepackage[pdfpagelayout=TwoPageRight]{hyperref}
\usepackage{multicol}
\usepackage{apacite}
\usepackage{textcomp}
\usepackage{chngcntr}
\usepackage{adjustbox}
\hypersetup{colorlinks=true, linktoc=all, allcolors=green!30!black,}
\usepackage{booktabs, siunitx, caption}
\newcommand{\source}[1]{\vspace{-8pt} \caption*{ Source: {#1}} }
\usepackage{amsmath}
\usepackage{graphicx}
\usepackage{slashbox}
\usepackage[caption=false]{subfig}
\usepackage{array}
\usepackage{pgfplots}
\pgfplotsset{compat=1.11,
/pgfplots/ybar legend/.style={
/pgfplots/legend image code/.code={%
\draw[##1,/tikz/.cd,yshift=-0.25em]
(0cm,0cm) rectangle (3pt,0.8em);},},}
\usetikzlibrary{arrows}
\begin{filecontents}{installations.csv}
Name, Quantity
"Japan", 66
"China", 12
"Korea", 8
"Other", 23
\end{filecontents}
\begin{filecontents}{installedcapacity.csv}
Name, Quantity
"Japan", 95.516
"China", 394.258
"Korea", 16.901
"Other", 14.589
\end{filecontents}
\begin{document}
%Wheelchart specifications
\pgfplotstableread[ignore chars=",col sep=comma]{installations.csv}\datainstallations
\pgfplotstableread[ignore chars=",col sep=comma]{installedcapacity.csv}\datacapacity
\pgfplotstableread{
clr
blue!70!black
red!70!black
black!70!white
white!70!black
}\MyColors
% Adjusts the size of the wheel:
\def\innerradius{1.5cm}
\def\outerradius{2cm}
\newcommand\LabelName{}
\newcommand\LabelValue{}
% The main macro
\newcommand{\wheelchart}[2]{ % <--- (from 1 to 2)
% Calculate total
\pgfmathsetmacro{\totalnum}{0}
% get number of rows in table
\pgfplotstablegetrowsof{#1}
% minus 1 because indexing starts as zero
\pgfmathsetmacro{\RowsInTable}{\pgfplotsretval-1}
\foreach \i in {0,...,\RowsInTable} {
\pgfplotstablegetelem{\i}{Quantity}\of{#1}
\pgfmathparse{\pgfplotsretval+\totalnum}
\global\let\totalnum=\pgfmathresult
}
\begin{center}
\begin{tikzpicture}
% The text in the center of the wheel
\node[align=center,text width=2*\innerradius] {\pgfmathprintnumber{\totalnum}~{#2}}; % <--- (name is now defined by second option of the command \wheelchart
% Calculate the thickness and the middle line of the wheel
\pgfmathsetmacro{\wheelwidth}{\outerradius-\innerradius}
\pgfmathsetmacro{\midradius}{(\outerradius+\innerradius)/2}
% Rotate so we start from the top
\begin{scope}[rotate=90]
% Loop through each value set. \cumnum keeps track of where we are in the wheel
\pgfmathsetmacro{\cumnum}{0}
\foreach \i in {0,...,\RowsInTable} {
% get values from table
\pgfplotstablegetelem{\i}{Name}\of{#1}\global\let\LabelName=\pgfplotsretval
\pgfplotstablegetelem{\i}{Quantity}\of{#1}\renewcommand\LabelValue{\pgfplotsretval}
\pgfmathsetmacro{\newcumnum}{\cumnum + \LabelValue/\totalnum*360}
% Calculate the percent value
\pgfmathsetmacro{\percentage}{\LabelValue}
% Calculate the mid angle of the colour segments to place the labels
\pgfmathsetmacro{\midangle}{-(\cumnum+\newcumnum)/2}
% This is necessary for the labels to align nicely
\pgfmathparse{
(-\midangle<180?"west":"east")
} \edef\textanchor{\pgfmathresult}
\pgfmathsetmacro\labelshiftdir{ifthenelse(\RowsInTable==0,-1,1)*(1-2*(-\midangle>180))}
% Draw the color segments. Somehow, the \midrow units got lost, so we add 'pt' at the end. Not nice...
\pgfplotstablegetelem{\i}{clr}\of{\MyColors}
\fill[color=\pgfplotsretval] (-\cumnum:\outerradius) arc (-\cumnum:-(\newcumnum):\outerradius) --
(-\newcumnum:\innerradius) arc (-\newcumnum:-(\cumnum):\innerradius) -- cycle;
% Draw the data labels
\pgfmathsetmacro\labelmag{
1 + .9*(abs(1/sin(\midangle)))^1 - .03*(abs(1/sin(\midangle)))^2}
\draw [*-,thin] node [append after command={(\midangle:\midradius pt) --
(\midangle:\outerradius + \labelmag ex) -- (\tikzlastnode)}] at
(\midangle:\outerradius + \labelmag ex)
[xshift=\labelshiftdir*0.5cm,inner sep=0pt, outer sep=0pt, ,anchor=\textanchor]{\LabelName: \pgfmathprintnumber{\percentage}};
% Set the old cumulated angle to the new value
\global\let\cumnum=\newcumnum
}
\end{scope}
% \draw[gray] (0,0) circle (\outerradius) circle (\innerradius);
\end{tikzpicture}
\end{center}
}
\begin{figure}[!htb]
\centering
\begin{tikzpicture}
\begin{axis}[
width=0.9\linewidth,
height=0.4\linewidth,
ybar,bar width=25pt, enlarge x limits=0.15, ymin=0,
legend style={at={(0.5,1.15)},anchor=north,legend columns=2},
ylabel={Installed capacity (MW\textsubscript{p})},
xticklabels={$<2014$, $2014$, $2015$, $2016$, $2017$}, % set ticklabels explicitly
xtick=data, nodes near coords, axis lines*=left, ymajorgrids
]
\addplot[red!50!black, fill=red!70!black] coordinates {(2013, 1.7) (2014, 3.0) (2015, 49.5) (2016, 70.7) (2017, 396.5)};
\addplot[blue!50!black, fill=blue!70!black] coordinates {(2013, 1.7) (2014, 4.7) (2015, 54.2) (2016, 124.9)(2017, 521.4)};
\legend{Annual installed capacity, Cumulative installed capacity}
\end{axis}
\end{tikzpicture}
\caption{Global installed capacity of floating photovoltaics}
\label{fig:capacity over time}
\end{figure}
What I'm trying to do is:
\begin{figure}[h]
\centering
\subfloat[Global installed capacity of floating photovoltaics]{%
\begin{tikzpicture}
\begin{axis}[
width=0.9\linewidth,
height=0.4\linewidth,
ybar,bar width=25pt, enlarge x limits=0.15, ymin=0,
legend style={at={(0.5,1.15)},anchor=north,legend columns=2},
ylabel={Installed capacity (MW\textsubscript{p})},
xticklabels={$<2014$, $2014$, $2015$, $2016$, $2017$}, % set ticklabels explicitly
xtick=data, nodes near coords, axis lines*=left, ymajorgrids
]
\addplot[red!50!black, fill=red!70!black] coordinates {(2013, 1.7) (2014, 3.0) (2015, 49.5) (2016, 70.7) (2017, 396.5)};
\addplot[blue!50!black, fill=blue!70!black] coordinates {(2013, 1.7) (2014, 4.7) (2015, 54.2) (2016, 124.9)(2017, 521.4)};
\legend{Annual installed capacity, Cumulative installed capacity}
\end{axis}
\end{tikzpicture}
}
\subfloat[Installations per country]{%
\wheelchart{\datainstallations}{Installations}
}
\subfloat[Installed capacity per country]{%
\wheelchart{\datacapacity}{MW\textsubscript{p}}
}
\caption{FPV installations and capacity in late 2017}
\label{fig:capacity and installations per country}
\source{Adapted from \shortcite{DeJong2018}}
\end{figure}
I hope you guys get what I'm trying to do. I want figure 1.1,1.2 and 1.3 to become 1.1 (a), 1.1 (b), 1.1 (c) and add the source at the bottom

\sourcecommand misses its closing}. Instead of thesubfigcommand from thesubfigpackage, you could try thesubfigureenvironment from thesubcaptionpackage. (As a side note: both packages are incompatible with each other.) – leandriis Jul 08 '18 at 14:59}was a typo. Thanks for spotting it, but does not change anything. I'd rather not switch to another environment, because I have all my figures in thesubfigstyle now – Hans Jul 08 '18 at 15:36subfigpackage, you could try to enclose both\wheelchartcommands in\begin{minipage}[b]{0.5\textwidth}commands, as already done by Zarko in their anwer to your previous question. – leandriis Jul 08 '18 at 16:37standaloneand then including those in your document. – Jul 08 '18 at 17:29