Though this is the answer to your question, I believe this is not the answer you need. Look for "dynamically changing ChartJS data". Basically, you can use chart.addData and chart.removeData functions to update a chart's data.

Email codedump link for Is it possible to dynamically replace the script section of an html page?