8 – How to push attachment values ​​of views to Javascript?

I have a table view with filters and filters exposed, and attached to it is another view that uses views_aggregator_plus to show a summary of months and different values.

I want the attached file to be displayed, so I attached the ChartJs script to the page view and had another cycle of functions through the rows of the html table of the attached file to get the data and separate each column in its own matrix .

This works although I'm not sure. It does not feel good
Would not it be better if I entered the values ​​of the view directly into the script instead of the browser?

I'm not sure how to do it, but I found the necessary values ​​in hook_view_post_render in $ view-> style_plugin-> rendering_fields ..

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

Thank you,