duanjieyi6582 2014-11-20 02:25
浏览 51
已采纳

如何安装phpChart lite库?

I'm running Ubuntu with LAMPP and I do not really understand how set up the library. When I run an example, I get this error:

Warning: require_once(/opt/lampp/htdocs//phpChart_Lite//conf.php): failed to open stream: No existe el archivo o el directorio in /opt/lampp/htdocs/simulacion_tecnodi/phpChart_Lite/server/cls_conf.php(1) : eval()'d code on line 1

Fatal error: require_once(): Failed opening required '/opt/lampp/htdocs//phpChart_Lite//conf.php' (include_path='.:/opt/lampp/lib/php') in /opt/lampp/htdocs/simulacion_tecnodi/phpChart_Lite/server/cls_conf.php(1) : eval()'d code on line 1

The example code:

<?php
require_once("../conf.php");
?>
<!DOCTYPE HTML>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>phpChart - Bar Test</title>
</head>
    <body>
    <div><span> </span><span id="info1b"></span></div>

<?php
$s1 = array(2, 6, 7, 10);
$ticks = array('a', 'b', 'c', 'd');

$pc = new C_PhpChartX(array($s1),'chart1');
$pc->add_plugins(array('highlighter','pointLabels'));
$pc->set_animate(true);
$pc->set_series_default(array(
    'renderer'=>'plugin::BarRenderer',
    'pointLabels'=> array('show'=>true)));
$pc->set_axes(array(
     'xaxis'=>array(
        'renderer'=>'plugin::CategoryAxisRenderer',
        'ticks'=>$ticks)
));
$pc->set_highlighter(array('show'=>false));
$pc->bind_js('jqplotDataClick',array(
    'series'=>'seriesIndex',
    'point'=>'pointIndex',
    'data'=>'data'));
$pc->draw(400,300);
?>
</body>
</html>

Here is the conf.php file code:

<?php
define('SCRIPTPATH','/phpChart_Lite/');
define('DEBUG', true);
/******** DO NOT MODIFY ***********/
require_once('phpChart.php');     
/**********************************/
?>
  • 写回答

1条回答 默认 最新

  • dongpo8250 2015-07-09 14:23
    关注

    The way the file is zipped causes multiple "phpChart_Lite" folders to be created. In line 2 of your php.conf file, make sure the path is like this:

    define('SCRIPTPATH','[YOUR PATH HERE]/phpChart_Lite/phpChart_Lite');
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 delta降尺度计算的一些细节,有偿
  • ¥15 Arduino红外遥控代码有问题
  • ¥15 数值计算离散正交多项式
  • ¥30 数值计算均差系数编程
  • ¥15 redis-full-check比较 两个集群的数据出错
  • ¥15 Matlab编程问题
  • ¥15 训练的多模态特征融合模型准确度很低怎么办
  • ¥15 kylin启动报错log4j类冲突
  • ¥15 超声波模块测距控制点灯,灯的闪烁很不稳定,经过调试发现测的距离偏大
  • ¥15 import arcpy出现importing _arcgisscripting 找不到相关程序