If you look at your active template, most of the cases in the file called index.php.
You can find a tag to render the component:
<jdoc: include type = "component" />
And some others to render the modules according to their position:
<jdoc:include type="modules" name="top" style="xhtml"/>
This one will ...
Your original coding attempt is repeatedly overwriting the $dataPoints variable inside of the loop -- this is why you only see the last iteration's data.
To create the desired multidimensional array directly from the query's result set, here is the way to use column aliases and Joomla's query building syntax.
$db = JFactory::getDbo();
$query = $db->...
I added this code to the menu's main php file (about line 53 in the default.php override):
$class .= ' single';
Then in the template.js added this:
let single = [...document....