php教程|php手册
aspnet,软件编程
php教程-php手册
php jpgraph库非常强大,可以在后台生成图片
vpn 易源码,新装Ubuntu系统很卡,如何防止tomcat内存溢出来,python爬虫思维,php判断是不是为数组,金堂seo定做lzw
后台生成在需要导出图表型报告的时候非常有用,当然,前端的可视化还是要用highcharts/echarts/anycharts等类库
聊天框源码网页,ubuntu开通ssh教程,path爬虫的用法,php循环内容,seo步骤 pdflzw
比较麻烦的是中文乱码问题,有3个地方乱码:
龙华3d捕鱼 源码,vscode怎么远程调试,最新ubuntu,tomcat6.0安装版,为什么现在都用sqlite,新年网页设计,mssql 导入数据库,怎么查看dns服务器,owl carousel插件,H5演示 前端框架,爬虫网页数据,php的工作,专业seo优化推广,离线版springboot,正则表达式 img 标签,网站木马清理,左侧导航滑动网页定位,源码哥网站的模板,网站后台更换首页图片,ecshop 积分商城页面,java订单管理系统源码,vb简单程序lzw
legend
setStickLabels
title
先说明下我的环境和版本:
Ubuntu12.04
PHP 5.3.10-1
Jpgraph 3.5.0b1
文件fileencoding=utf-8
Legend 乱码
//jpgraph_legend.inc.php 3 class Legend { 2public $txtcol=array(); 1//public $font_family=FF_DEFAULT,$font_style=FS_NORMAL,$font_size=8; // old. 12 0public $font_family=FF_SIMSUN,$font_style=FS_NORMAL,$font_size=8; // old. 12
记得下载一份 simsun.ttc 放到 /usr/share/fonts/truetype
//jpgraph_ttf.inc.php 9 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 }
原创文章,转载请注明:/phpgcs/
上面的解决方法,我是参考了:
/yiping1980/article/details/6023144
然后后面的2个我认为就是找到title/stickLabels源码的地方,将 FFDEFAULT 改为 FFSIMSUN 即可
后来证明果然是这样,而且方便的是 这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 { 4public $scale=null; 3public $img=null; 2public $hide=false,$hide_labels=false; 1public $title=null; 0public $font_family=FF_DEFAULT,$font_style=FS_NORMAL,$font_size=8,$label_angle=0;
还有个地方也有FF_DEFAULT,
5 class DisplayValue { 4public $margin=5; 3public $show=false; 2public $valign=\,$halign=center; 1public $format=\%.1f,$negformat=\; 0private $ff=FF_DEFAULT,$fs=FS_NORMAL,$fsize=8;
总结:
找到相关的源码(FF_DEFAULT)
修改 jpgraphttf.inc.php, $aFF === FFSIMSUN 则直接返回 $aTx
原创文章,转载请注明:/phpgcs/
如果觉得《jpgraph中文乱码问题的解决》对你有帮助,请点赞、收藏,并留下你的观点哦!