|
[1] jpgraph 解压后文件放到的 mantis跟目录下的library\jgraph子目录,实际php文件是在 ipgraph/src目录
[2] 修改PHP配置文件:一般在c:\WINDOWS\php.ini
extension=php_gd2.dll //将前面分号去掉;
[3] 修改mantis配置文件:config.inc.php, 增加四行
$g_use_jpgraph = ON;
$g_jpgraph_path = 'D:\WebSite\NewMantis\newmantis\library\jpgraph\\'; //jpgraph安装目录
$g_graph_font = 'simsun'; //这是为了解决jgraph显示图形中的中文乱码问题
[4] 修改mantis配置文件:config.default.inc.php
$g_use_jpgraph = ON;
$g_jpgraph_path = 'D:\WebSite\NewMantis\newmantis\library\jpgraph\\';
另外,config.default.inc.php ,我的语言设置是:
$g_default_language = 'chinese_simplified';
$g_fallback_language = 'chinese_simplified';
[5] 修改mantis API文件:~/core/graph.api.php
找到graph_get_font()增加:
'simsun' => FF_SIMSUN,
[6] 修改jpgraph配置文件:jpg-config.inc.php
增加:
DEFINE('CACHE_DIR','c:/windows/temp/jpgraph_cache/');
DEFINE('TTF_DIR','c:/windows/fonts/');
DEFINE('MBTTF_DIR','c:/windows/fonts/');
DEFINE('CHINESE_TTF_FONT','simsun.ttc');
[7] 修改jpgraph中的文件:~\library\jpgraph\jpgraph.ttf.inc.php
找到function Convert($aTxt,$aFF) 里面的代码:
elseif( $aFF === FF_SIMSUN ) {
// Do Chinese conversion
if( $this->g2312 == null ) {
include_once 'jpgraph_gb2312.php' ;
$this->g2312 = new GB2312toUTF8();
}
return $this->g2312->gb2utf8($aTxt);
}
把这段全注释掉
/*
elseif( $aFF === FF_SIMSUN ) {
// Do Chinese conversion
if( $this->g2312 == null ) {
include_once 'jpgraph_gb2312.php' ;
$this->g2312 = new GB2312toUTF8();
}
return $this->g2312->gb2utf8($aTxt);
}
*/
[8] jpgraph配置完成
附件就是jpgraph-2.3.tar.gz已经配好的文件,已经完成步骤[6]和[7],直接Copy到Mantis目录下即可 |
|