make graph viewable server side

in order to do this i had to put the json we generated directly into
the javascript, which is not ideal, however this way we don’t have to
make a XMLHttpRequest which has been proving difficult to achieve