在 Zend MVC 上打开 Flash Chart 错误

发布于 2024-08-25 23:13:07 字数 635 浏览 8 评论 0原文

我最近下载了 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 字符串。 我缺少什么?

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-files/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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

゛时过境迁 2024-09-01 23:13:07

只是为了帮助那些可能遇到同样问题的人。
我调整了我的代码以使其

<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>

完美运行。

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文