如何安装phpChart lite库?

时间:2014-11-20 02:25:28

标签: php charts

我正在使用LAMPP运行Ubuntu,我真的不明白如何设置库。当我运行一个例子时,我收到了这个错误:

  

警告:require_once(/opt/lampp/htdocs//phpChart_Lite//conf.php):无法打开流:/ opt / lampp / htdocs / simulacion_tecnodi / phpChart_Lite / server / cls_conf中没有existe el archivo o el directorio .php(1):第1行的eval()'代码

  

致命错误:require_once():无法打开所需' /opt/lampp/htdocs//phpChart_Lite//conf.php' (include_path ='。:/ opt / lampp / lib / php')/opt/lampp/htdocs/simulacion_tecnodi/phpChart_Lite/server/cls_conf.php(1):eval()' d第1行的代码

示例代码:

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

这是conf.php文件代码:

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

1 个答案:

答案 0 :(得分:1)

压缩文件的方式导致多个&#34; phpChart_Lite&#34;要创建的文件夹。在php.conf文件的第2行中,确保路径如下:

define('SCRIPTPATH','[YOUR PATH HERE]/phpChart_Lite/phpChart_Lite');