我最近下载了Open Flash Chart源代码,我已将它集成到我的Zend MVC中。因为我使用自动加载器 我已重命名我的文件并评论了“require_once”源代码行。
但是当我尝试加载我的图表时
<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>
它会加载"/data-files/y-axis-auto-steps.txt"
而我无法找出原因。
我的控制器返回我希望呈现的JSON字符串。 我错过了什么?
答案 0 :(得分:1)
只是为了帮助那些可能遇到同样问题的人。 我调整了我的代码以阅读
<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>
效果很好。