您好,欢迎访问一九零五行业门户网

PHP JpGraph中文乱码解决方式

jpgraph默认不支持中文,需要我们进行设置
但是实际测试中,我们只需要修改2个地方即可,位置是jpgraph_ttf.inc.php
setscale('intlin');$graph->setshadow();// setup margin and titles$graph->setmargin(40,20,20,40);$graph->title->set('标题---统计图');$graph->subtitle->set('(march 12, 2008)');$graph->xaxis->title->set('x(跨度)');$graph->yaxis->title->set('y(指数)');// create the first data series$lineplot=new lineplot($ydata);$lineplot->setweight( 2 ); // two pixel wide// add the plot to the graph$graph->add($lineplot);// create the second data series$lineplot2=new lineplot($ydata2);$lineplot2->setweight( 2 ); // two pixel wide// add the second plot to the graph$graph->add($lineplot2);// display the graph$graph->stroke();?>
其它类似信息

推荐信息