JPgraph中文乱码问题解决

来源:互联网 发布:健身 知乎 编辑:程序博客网 时间:2024/04/29 13:38

1.首先设置字体,如标题:

$graph->title->SetFont(FF_SIMSUN,FS_BOLD,14);

2.修改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);return $aTxt;        }


按照上述方法注释掉,直接返回$aTxt即可。

 

原创粉丝点击