I recently downloaded the Open Flash Chart source code and I have intergrated it into my Zend MVC.Since I use the autoloader I have renamed my files and commented the "require_once" source lines.
However when I try to load my chart
<script type="text/javascript">
swfobject.embedSWF(
"<?php echo $this->baseUrl() ?>/swf/open-flash-chart.swf",
"my_chart", "550", "200",
"9.0.0",
"<?php echo $this->baseUrl() ?>/swf/expressInstall.swf",
{"data-file":"<?php echo $this->baseUrl()?>/reportexpense/piechart/"}
);
</script>
it loads the "/data-file开发者_如何学JAVAs/y-axis-auto-steps.txt"
instead and I cant figure out why.
My controller returns the JSON string which I expect to be rendered. What am I missing?
Just to help out those who might come across the same problem. I adjusted my code to read
<script type="text/javascript">
swfobject.embedSWF(
"<?php echo $this->baseUrl() ?>/swf/open-flash-chart.swf",
"my_chart", "550", "200",
"9.0.0",
"<?php echo $this->baseUrl() ?>/swf/expressInstall.swf",
{"get-data":"get_data_1"}
);
function ofc_ready()
{
//alert('ofc_ready');
}
function get_data_1()
{
return JSON.stringify(<?php echo $this->myreport?>);
}
</script>
It worked perfectly.
精彩评论