建议你下载试用这个图表组件 免费的! http://www.wave12.com/web/SigCon.asp?bCate=41&sCateName=折线图&ID=151&CateName=wsChart3.6导航

解决方案 »

  1.   

    to zc1966() : 我用的是 $graph->title->SetColor(#....)
    呢。可就是不起作用。文件如下:<?php
    include ("src/jpgraph.php");
    include ("src/jpgraph_log.php");
    include ("src/jpgraph_line.php");if(array_key_exists("ydata",$_POST)) $ydata=$_POST['ydata'];
    elseif(array_key_exists("ydata",$_GET)) $ydata=$_GET['ydata'];
    else $ydata = "";//折线数据1
    if(array_key_exists("ydata2",$_POST)) $ydata2=$_POST['ydata2'];
    elseif(array_key_exists("ydata2",$_GET)) $ydata2=$_GET['ydata2'];
    else $ydata2 = "";//折线数据2if(array_key_exists("graphWidth",$_POST)) $graphWidth=$_POST['graphWidth'];
    elseif(array_key_exists("graphWidth",$_GET)) $graphWidth=$_GET['graphWidth'];
    else $graphWidth = 500;//折线图宽
    if(array_key_exists("graphHeight",$_POST)) $graphHeight=$_POST['graphHeight'];
    elseif(array_key_exists("graphHeight",$_GET)) $graphHeight=$_GET['graphHeight'];
    else $graphHeight = 300;//折线图高$xtitle=$_REQUEST["xtitle"];
    $ytitle=$_REQUEST["ytitle"];
    $graphtitle=$_REQUEST["graphtitle"];
    $plot1title=$_REQUEST["plot1title"];
    $plot2title=$_REQUEST["plot2title"];$ydata = explode(",",$ydata);
    $ydata2 = explode(",",$ydata2);// Create the graph. These two calls are always required
    $graph = new Graph($graphWidth,$graphHeight,"auto");
    $graph->SetScale("textlin");// Show the gridlines
    $graph->ygrid->Show(true,true);
    $graph->xgrid->Show(true,false);// Create the linear plot
    $lineplot=new LinePlot($ydata);
    $lineplot2=new LinePlot($ydata2);// Add the plot to the graph
    $graph->Add($lineplot);
    $graph->Add($lineplot2);$graph->img->SetMargin(50,50,30,80);$graph->title->Set("$graphtitle");
    $graph->title->SetColor("blue");$graph->xaxis->title->Set($xtitle);
    $graph->yaxis->title->Set($ytitle);
    $graph->yaxis->title->SetColor("blue");
    $graph->xaxis->title->SetColor("blue");$graph->title->SetFont(FF_SIMSUN,FS_BOLD,14);
    $graph->yaxis->title->SetFont(FF_SIMSUN,FS_BOLD,14);//
    $graph->xaxis->title->SetFont(FF_SIMSUN,FS_BOLD,14);
    $lineplot->SetColor("blue");
    $lineplot->SetWeight(2);$lineplot2->SetColor("orange");
    $lineplot2->SetWeight(2);//Y轴颜色和宽度
    $graph->yaxis->SetColor("red");
    $graph->yaxis->SetWeight(2);$graph->SetShadow();$graph->legend->SetFont(FF_SIMSUN,FS_BOLD,14);
    $graph->legend->SetColor("blue");$lineplot->SetLegend($plot1title);//标示两条折线的含义。
    $lineplot2->SetLegend($plot2title);//$graph->legend->Pos(0.50,0.9,"center","center");// Display the graph
    $graph->Stroke();
    ?>