Codeigniter 中的 FusionCharts 错误:FusionCharts 未定义

发布于 2024-09-30 16:40:33 字数 2425 浏览 2 评论 0原文

大家好,我正在尝试在 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 技术交流群。

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

发布评论

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

评论(1

入画浅相思 2024-10-07 16:40:33

在您的控制器中,尝试:

function index()
 {
$this->load->plugin( 'fusion' );  
$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...");  
$data['chart'] = $FC->renderChart();  

$this->load->view("jquery_view", $data);
 }

在您的视图中,尝试:

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

        <? echo $chart; ?>

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

In your controller, try:

function index()
 {
$this->load->plugin( 'fusion' );  
$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...");  
$data['chart'] = $FC->renderChart();  

$this->load->view("jquery_view", $data);
 }

On your view, try:

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

        <? echo $chart; ?>

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