当前位置:Gxlcms > PHP教程 > PHPJpGraph中文乱码解决方式

PHPJpGraph中文乱码解决方式

时间:2021-07-01 10:21:17 帮助过:9人阅读

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();?>

人气教程排行