各位好:
在使用Jpgraph时,为了在图片上显示中文,使用了“$graph->title->setFont(FF_SIMSUN,FS_BOLD,30);”,但是一旦使了这句后,总是显示不出来图片,显示的是x号,怎么回事?怎么解决?谢谢

解决方案 »

  1.   

    这个,只能用其指定的几种字体。
    在其手册中有的,我记得中文不超过5种。SIMSUN,是这个吗?
      

  2.   

    打开错误报告,手动跑图片的url,关闭图片的content-type,看错误就知道了
      

  3.   

    acabin您能再具体点吗?您看一下我使用的jpgraph库,只是想在图片上显示中文,但是就是显示不出来呀?
    <?php // content="text/plain; charset=utf-8"
    require_once ('jpgraph/jpgraph.php');
    require_once ('jpgraph/jpgraph_bar.php');$datay1=array(13,8,19);
    $datay2=array(0,0,0);// Create the graph.
    $graph = new Graph(350,250);
    $graph->SetScale('textlin');
    $graph->SetMarginColor('silver');// Setup title
    $graph->title->Set("我是中国人");
    $graph->title->setFont(FF_SIMSUN,FS_BOLD,30);
    // Create the first bar
    $bplot = new BarPlot($datay1);
    $bplot->SetFillGradient('AntiqueWhite2','AntiqueWhite4:0.8',GRAD_VERT);
    $bplot->SetColor('darkred');// Create the second bar
    $bplot2 = new BarPlot($datay2);
    $bplot2->SetFillGradient('olivedrab1','olivedrab4',GRAD_VERT);
    $bplot2->SetColor('darkgreen');// And join them in an accumulated bar
    $accbplot = new AccBarPlot(array($bplot,$bplot2));
    $graph->Add($accbplot);$graph->Stroke();
    ?>
      

  4.   

    现在还有多少人用 jpgraph ?反正我是不用啦
    jpgraph 显示中文的问题不是早就修正过了吗?怎么还有中文问题?
      

  5.   

    现在已经不用jpgraph啦?那现在php用什么做图呀?请教
      

  6.   

    gd2不是php的扩展库吗?使用gpgraph也得打开gd2扩展库呀?两者不是分离的吧?何谈不用gpgraph?而只是使用gd2???
      

  7.   

    画图建议直接调googleAPI 省事省心~