How to push values from views attachment to Javascript? I have a table view with both filters and exposed filters, and attached to it there is another view that uses views_aggregator_plus to display a summary of months and different value counts.

I want to have the attachment visualized so I attached ChartJs script to the page view and had another function loop through the attachment html table rows to fetch the data while separating each column into its own array. 

This works though I am not sure. It doesn't feel right.
Wouldn't it be better if I pushed the values from the view directly to the script rather than have it done by the browser?

I am not sure about how to do it, but I found the values needed in hook_view_post_render under $view->style_plugin->rendered_fields..

How to proceed from there? Or maybe there is an entirely different and better way to achieve the same?

Thanks,
It really depends on what you want and what data structure you have.
Normally I would say if you want only chart on the page/views, than create a new views type (Like block, page, etc) and then you can do whatever you want, and you can still attach it to another views. (I think this is it: https://www.drupal.org/docs/8/creating-custom-modules/building-a-views-display-style-plugin-for-drupal-8)
If you just want to show a chart side-by-side with some other data, maybe you need to create a new field (for views), than you can put there the stuff. (https://www.webomelette.com/creating-custom-views-field-drupal-8)
You can also hook in any time to a view, but it will make a mess after a while, however, every time you need to use the drupalSettings (Pass variable to drupalSettings) if you want to pass php data to javascript and some custom JS code to glue the ChartJS to the drupalSettings.