As you can see my code below, I have defined a $test variable in controller. The problem is, when I passing the variable to js, it became different result.
Controller
$test = "{name: 'John',color: 'olive',data: [5, 3, 4, 7, 2],stack: '2014',xAxis: 1}";
View
<script type="text/javascript">
var test = {{$test}}; // result is {name: 'John',color: 'olive',data: [5, 3, 4, 7, 2],stack: '2014',xAxis: 1};
</script>
Inspect

json_encoded($formedObject)instead.