1. Mantis安装配置jpgraph
1.1. 下载安装
(1)下载地址:
http://jpgraph.net/download/
这里使用:jpgraph-3.5.0b1.tar.gz
(2)解压其子目录src至mantis\library目录下,并改名为:jpgraph;
(3)确认PHP中有加载jpgraph使用的动态库:extension=php_gd2.dll
(4)安装插件:管理-插件管理-安装MantisGraph插件
(5)修改MantisGraph插件配置
要使用的图形库修改为:JpGraph
JpGraph 库系统路径:设置为对应的jpgraph路径;
例:D:\Program Files\EasyPHP-12.1\www\mantis\library\jpgraph
1.2. 修改mantis\library\jpgraph\jpgraph_ttf.inc.php
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);
}
=》
//2013-01-09 luly 解决jpgraph中文乱码问题
/*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 ) {
return $aTxt;
}
1.3. 修改mantis\plugins\MantisGraph\pages\config.php
(1)增加字体simsun
$t_current_font_selected = array(
'arial' => false,
=》
$t_current_font_selected = array(
//2013-01-09 luly 解决jpgraph中文乱码问题
'simsun' => false,
'arial' => false,
(2)配置页面显示新增加的simsun(宋体)
<td style="vertical-align: top">
Sans-serif:<br />
<label><input type="radio" name="font" value="arial"<?php echo print_font_checked( 'arial' )?>/>Arial</label><br />
=》
<td style="vertical-align: top">
Sans-serif:<br />
<!--2013-01-09 luly 解决jpgraph中文乱码问题 -->
<label><input type="radio" name="font" value="simsun"<?php echo print_font_checked( 'simsun' )?>/>宋体</label><br />
<label><input type="radio" name="font" value="arial"<?php echo print_font_checked( 'arial' )?>/>Arial</label><br />
注:因直接使用中文,为不显示为乱码,需要把该代码文件,转换成UTF-8编码格式,文件另存为时选择即可;
1.4. 修改mantis\plugins\MantisGraph\pages\config_edit.php
if ( plugin_config_get( 'font' ) != $f_font ) {
switch ( $f_font ) {
case 'arial':
=》
if ( plugin_config_get( 'font' ) != $f_font ) {
switch ( $f_font ) {
//2013-01-09 luly 解决jpgraph中文乱码问题
case 'simsun';
case 'arial':
1.5. 修改mantis\plugins\MantisGraph\core\graph_api.php
$t_font_map = array(
'arial' => FF_ARIAL,
=》
$t_font_map = array(
//2013-01-09 luly 解决jpgraph中文乱码问题
'simsun' => FF_SIMSUN,
'arial' => FF_ARIAL,
1.6. 修改MantisGraph插件配置
管理-插件管理-MantisGraph插件
编辑配置,修改字体为“宋体”