score:1

Accepted answer

i'm not sure why you're having problems, i don't think you should be.

but i have a better answer for you, use buffers instead of heredocs (they're easier to work with anyway)

google ob_start to learn how it works, they're super useful

ob_start()?>
<script type="text/javascript">
var ctx = document.getelementbyid("mychart").getcontext("2d");

chart.types.bar.extend({
    name: "mychart",
    initialize: function () {
        chart.types.bar.prototype.initialize.apply(this, arguments);
    }
});

new chart(ctx).mychart(data, {
    scalelabel : "<%= value + ' $' %>"
});

</script>
<?php $chart = ob_get_clean();
echo $chart;

Related Query

More Query from same tag