How to install phpChart lite library?

匆匆过客 提交于 2020-01-06 14:40:34

问题


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:


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');


来源:https://stackoverflow.com/questions/27030660/how-to-install-phpchart-lite-library

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!