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 c语言怎么用printf(“\b \b”)与getch()实现黑框里写入与删除?
  • ¥20 怎么用dlib库的算法识别小麦病虫害
  • ¥15 华为ensp模拟器中S5700交换机在配置过程中老是反复重启
  • ¥15 java写代码遇到问题,求帮助
  • ¥15 uniapp uview http 如何实现统一的请求异常信息提示?
  • ¥15 有了解d3和topogram.js库的吗?有偿请教
  • ¥100 任意维数的K均值聚类
  • ¥15 stamps做sbas-insar,时序沉降图怎么画
  • ¥15 买了个传感器,根据商家发的代码和步骤使用但是代码报错了不会改,有没有人可以看看
  • ¥15 关于#Java#的问题,如何解决?