Codeigniter 中的 FusionCharts 错误:FusionCharts 未定义
大家好,我正在尝试在 Codeigniter 中使用融合图表。我只是按照指示进行操作 http://www.ikawka.com/2008/12/ fusion-chart/comment-page-1/
我看到错误
“FusionCharts 未定义”
firebug 中 。在查看页面我只看到
“图表。”
插件文件夹中有名为 fusion_pi.php 的文件
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
function FusionCharts( $chart_type='Column3D', $width = "300", $height = "250" ){
require_once('fusion/FusionCharts_Gen.php' );
$FC = new FusionCharts($chart_type,$width,$height);
$FC->setSWFPath("images/fusioncharts/");
return $FC;
}
?>
控制器:
function index()
{
// echo "hello world";
$this->load->view("jquery_view");
$this->load->plugin( 'fusion' );
echo "hi";
$FC = FusionCharts("Column3D","520","200");
$arrData = array( 500, 269, 254, 895, 633);
foreach( $arrData as $i=>$data ){
$FC->addChartData( $data );
}
$strParam="numberSuffix=%; formatNumberScale=0; decimalPrecision=0; xAxisName=Integrated Process Average Score; animation=1";
$FC->setChartParams($strParam);
$FC->setChartMessage("ChartNoDataText=Chart Data not provided; PBarLoadingText=Please Wait.The chart is loading...");
echo $FC->renderChart();
}
视图:
<html>
<head>
<script type="text/javascript" src="<?php echo base_url();?>js/FusionCharts.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/jquery-1.3.2.min.js" ></script>
<script type="text/javascript" src="<?php echo base_url();?>js/ajax.js" ></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php echo "Rajani". base_url()."js/FusionCharts.js";?>
<label for="name">UserName</label>
<input type="text" id="name" />
<input type="password" id="pwd" />
<input type="submit" name="submit" id="submit" value="submit" />
</body>
</html>
我发现视图文件中的行:js/FusionCharts.js"> 没有检测到。可能是什么问题? 需要帮助。
谢谢。
Hello all I am trying to use fusion charts in Codeigniter. I just followed the instruction from
http://www.ikawka.com/2008/12/fusion-chart/comment-page-1/
I see the error
"FusionCharts is not defined"
in firebug. On the view page I only see
"Chart."
Plugin folder has the file named fusion_pi.php
<?php if (!defined('BASEPATH')) exit('No direct script access allowed');
function FusionCharts( $chart_type='Column3D', $width = "300", $height = "250" ){
require_once('fusion/FusionCharts_Gen.php' );
$FC = new FusionCharts($chart_type,$width,$height);
$FC->setSWFPath("images/fusioncharts/");
return $FC;
}
?>
Controller:
function index()
{
// echo "hello world";
$this->load->view("jquery_view");
$this->load->plugin( 'fusion' );
echo "hi";
$FC = FusionCharts("Column3D","520","200");
$arrData = array( 500, 269, 254, 895, 633);
foreach( $arrData as $i=>$data ){
$FC->addChartData( $data );
}
$strParam="numberSuffix=%; formatNumberScale=0; decimalPrecision=0; xAxisName=Integrated Process Average Score; animation=1";
$FC->setChartParams($strParam);
$FC->setChartMessage("ChartNoDataText=Chart Data not provided; PBarLoadingText=Please Wait.The chart is loading...");
echo $FC->renderChart();
}
View:
<html>
<head>
<script type="text/javascript" src="<?php echo base_url();?>js/FusionCharts.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>js/jquery-1.3.2.min.js" ></script>
<script type="text/javascript" src="<?php echo base_url();?>js/ajax.js" ></script>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php echo "Rajani". base_url()."js/FusionCharts.js";?>
<label for="name">UserName</label>
<input type="text" id="name" />
<input type="password" id="pwd" />
<input type="submit" name="submit" id="submit" value="submit" />
</body>
</html>
I found that the line in view file: js/FusionCharts.js">
is not detecting. What might be the problem?
Need Help.
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
在您的控制器中,尝试:
在您的视图中,尝试:
In your controller, try:
On your view, try: