1.将windows字体文件(simhei.ttf,simsun.ttc)复制到 fonts目录下
2.注释掉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);
// }
3 设置字体改成
$graph->title->SetFont(FF_SIMSUN,FS_BOLD);
$graph->yaxis->title->SetFont(FF_SIMSUN,FS_BOLD);
$graph->xaxis->title->SetFont(FF_SIMSUN,FS_BOLD);