Use JSON.
In the following example $php_variable
can be any PHP variable.
In your code, you could use like the following:
drawChart(600/50, , ...)
In cases where you need to parse out an object from JSON-string (like in an AJAX request), the safe way is to use JSON.parse(..)
like the below:
var s = "";
var obj = JSON.parse(s);