对jpgraph 的乱码处理,首先是标题乱码:
$graph->title->Set($title); //设置标题
$graph->title->SetFont(FF_SIMSUN,FS_BOLD); //设置中文
然后修改:jpgraph_ttf.inc.php 里的 178 行
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);
*/
return $aTxt; //修改乱码(显示中文)
}
其次是 右上角的乱码处理:
修改:jpgraph_legend.inc.php 里 24 行
public $font_family=FF_SIMSUN,$font_style=FS_NORMAL,$font_size=8; //修改乱码
over!