做网站推广维护需要学些什么,fusion app,湖南长沙设计公司,合伙合同网站建设协议php jpgraph库非常强大#xff0c;可以在后台生成图片 后台生成在需要导出图表型报告的时候非常有用#xff0c;当然#xff0c;前端的可视化还是要用highcharts/echarts/anycharts等类库 比较麻烦的是中文乱码问题#xff0c;有3个地方乱码#xff1a; legendsetStickLab…php jpgraph库非常强大可以在后台生成图片 后台生成在需要导出图表型报告的时候非常有用当然前端的可视化还是要用highcharts/echarts/anycharts等类库 比较麻烦的是中文乱码问题有3个地方乱码 legendsetStickLabelstitle 先说明下我的环境和版本 Ubuntu12.04PHP 5.3.10-1Jpgraph 3.5.0b1文件fileencodingutf-8Legend 乱码 //jpgraph_legend.inc.php3 class Legend {2 public $txtcolarray();1 //public $font_familyFF_DEFAULT,$font_styleFS_NORMAL,$font_size8; // old. 120 public $font_familyFF_SIMSUN,$font_styleFS_NORMAL,$font_size8; // old. 12 记得下载一份 simsun.ttc 放到 /usr/share/fonts/truetype //jpgraph_ttf.inc.php9 elseif( $aFF FF_SIMSUN ) {8 // Do Chinese conversion 7 /*6 if( $this-g2312 null ) {5 include_once jpgraph_gb2312.php ;4 $this-g2312 new GB2312toUTF8();3 }2 return $this-g2312-gb2utf8($aTxt);1 */0 return $aTxt; 1 } 原创文章转载请注明http://www.cnblogs.com/phpgcs/ 上面的解决方法我是参考了 http://blog.csdn.net/yiping1980/article/details/6023144 然后后面的2个我认为就是找到title/stickLabels源码的地方,将 FF_DEFAULT 改为 FF_SIMSUN 即可 后来证明果然是这样而且方便的是 这2个家伙都在 jpgraph.php 文件中 直接 :%s/FF_DEFAULT/FF_SIMSUN/g 就搞定了 title 乱码 2 $this-title new Text();1 $this-title-ParagraphAlign(center);0 //$this-title-SetFont(FF_DEFAULT,FS_NORMAL); //FF_FONT2, FS_BOLD 1 $this-title-SetFont(FF_SIMSUN,FS_NORMAL); //FF_FONT2, FS_BOLD stickLables 乱码 5 class AxisPrototype {4 public $scalenull;3 public $imgnull;2 public $hidefalse,$hide_labelsfalse;1 public $titlenull;0 public $font_familyFF_DEFAULT,$font_styleFS_NORMAL,$font_size8,$label_angle0; 还有个地方也有FF_DEFAULT, 5 class DisplayValue {4 public $margin5;3 public $showfalse;2 public $valign,$haligncenter;1 public $format%.1f,$negformat;0 private $ffFF_DEFAULT,$fsFS_NORMAL,$fsize8; 总结 找到相关的源码FF_DEFAULT)修改 jpgraph_ttf.inc.php, $aFF FF_SIMSUN 则直接返回 $aTx原创文章转载请注明http://www.cnblogs.com/phpgcs/ 转载于:https://www.cnblogs.com/phpgcs/p/jpgraph_chinese_messy_code.html