如何在 Symfony 上实现 Open Flash Chart 2
我试图通过在我的控制器操作之一中包含 ofc2 库来在我的 symfony 项目上使用 Open Flash Chart 2。
不幸的是它不起作用。当我调用该操作时它不打印任何内容 :'(
有一个插件可以实现此目的,但它使用的是过时的 OFC 版本。
有人在其网站上成功显示过 Open Flash Chart 2 吗?
以下是方法我的控制器的操作文件看起来:
<?php
class chartActions extends sfActions{
public function executeTestChartData(sfWebRequest $request){
$this->getResponse()->setHttpHeader('Content-Type','text/plain');
include('/cidat/lib/php-ofc-library/open-flash-chart.php');
$title = new title( date("D M d Y") );
$bar = new bar();
$bar->set_values( array(9,8,7,6,5,4,3,2,1) );
$chart = new open_flash_chart();
$chart->set_title( $title );
$chart->add_element( $bar );
$output = $chart->toPrettyString();
return $this->renderText($output);
}
}
?>
提前致谢,
Vic
I'm trying to use Open Flash Chart 2 on my symfony project by including the ofc2 library on one of my controller's action.
Unfortunately it doesn't work. When i call the action it prints nothing :'(
There is a plugin for this, but it uses an outdated version of OFC.
Anyone have had any success showing Open Flash Chart 2 on their site?
Here's how my controller's actions file looks:
<?php
class chartActions extends sfActions{
public function executeTestChartData(sfWebRequest $request){
$this->getResponse()->setHttpHeader('Content-Type','text/plain');
include('/cidat/lib/php-ofc-library/open-flash-chart.php');
$title = new title( date("D M d Y") );
$bar = new bar();
$bar->set_values( array(9,8,7,6,5,4,3,2,1) );
$chart = new open_flash_chart();
$chart->set_title( $title );
$chart->add_element( $bar );
$output = $chart->toPrettyString();
return $this->renderText($output);
}
}
?>
Thanks in advance,
Vic
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
好吧,我终于解决了。这就是我所做的:
open-flash-chart.php
复制到/lib/php-ofc-library
include('/lib/php-ofc-library/open-flash-chart.php');
行动。就是这样。不要忘记清除缓存。
干杯
Ok, I finally solved it. Here's what I did:
open-flash-chart.php
to/lib/php-ofc-library
/apps/my-app/lib
directoryinclude('/lib/php-ofc-library/open-flash-chart.php');
from my controller's action.That's it. Don't forget to clear cache.
Cheers