如何安装phpChart lite库? [英] How to install phpChart lite library?

查看:191
本文介绍了如何安装phpChart lite库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用LAMPP运行Ubuntu,我不太理解如何设置库。当我运行一个例子,我得到这个错误:


警告:require_once(/ opt / lampp / htdocs // phpChart_Lite // conf。 php):无法打开流:没有存在于/opt/lampp/htdocs/simulacion_tecnodi/phpChart_Lite/server/cls_conf.php(1)中的存在:eval()'d代码第1行





致命错误:require_once 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



<$ p



$ b < $ p> <?php
require_once(../ conf.php);
?>
<!DOCTYPE HTML>
< html>
< head>
< meta http-equiv =Content-Typecontent =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);
/ ********不要修改*********** /
require_once('phpChart.php');
/ ********************************** /
?>


解决方案

文件被压缩的方式会导致多个phpChart_Lite要创建的文件夹。在php.conf文件的第2行,确保路径是这样:

  define('SCRIPTPATH','您的路径] / phpChart_Lite / 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');     
/**********************************/
?>

解决方案

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

这篇关于如何安装phpChart lite库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆