@jan_blaha
I'm kind of a Javascript novice so really any help/teaching is greatly appreciated. I'm at the point where I can take the request data via beforeRender in a script and push this data to an array in my JSON sample data.
My sample data now looks like this:
{ quarters:
[ { name: 'Q1 2016',
patientData: [Array],
totalSize: 5,
included: 3 },
{ name: 'Q2 2016',
patientData: [Array],
totalSize: 7,
included: 3 } ],
vizData:
[ [ 100, 3, 5, 43.84939195509823, 100 ],
[ 0, 3, 7, 0, 56.15060804490177 ] ] }
My issue now with using Highcharts visualizations. I'd like to read the vizData from the JSON and render a Highcharts graph with it. I have a function renderDupGraph in one of my assets that if passed vizData, can find the Highchart's library, and can find render <div id='container'> in template that it will create the graph.
Is it possible to either:
- Get vizData array with Handlebars syntax as an argument to this Highcharts function inside the template <script> tag?
- Additionally, this call needs to happen in template so that the Highcharts package can be found from the template <head> and also to find the target <div id='container'>.
OR
- Import Highcharts into my script and perform the call in an afterRender function?
- Here I would get data from req.data in afterRender
Thank you for any guidance!
-Austin