Accessing hugo's template variable inside Javascript files?

I bumped in this old thread and this solution is not working for me. I’m actually interested in processing json files and call chart.js to render the data.

Anyone has tried that?