折线图 的中文显示问题。
http://www.aditus.nu/jpgraph/jpdownload.php
我在这里下载了这个包。
可是显示的折线图上 显示的字体颜色我怎么就无法改变呢?
如果我用里面的例子,标题为英文,那么颜色是黑色的。可是当我改成中文后。颜色就成了黄色了,根本没法看清。无论我怎么调用里面的函数来改变字体颜色都没反应/
请问有人用过这个下载包里面的文件做图形吗?我如何改变字体的颜色呢?
我出来的折线图如下:
http://manage.wap2008.com/test/test.bmp
问题点数:20、回复次数:5Top
1 楼zc1966()回复于 2005-04-19 11:39:46 得分 10
$graph->title->SetColor(#....)Top
2 楼zhangjinzhicn(依米)回复于 2005-04-19 12:06:19 得分 10
建议你下载试用这个图表组件 免费的! http://www.wave12.com/web/SigCon.asp?bCate=41&sCateName=折线图&ID=151&CateName=wsChart3.6导航Top
3 楼michelle0618(小蝶)回复于 2005-04-19 12:34:48 得分 0
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 = "";//折线数据2
if(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();
?>
Top
4 楼michelle0618(小蝶)回复于 2005-04-19 13:15:26 得分 0
UPTop
5 楼michelle0618(小蝶)回复于 2005-04-19 14:29:46 得分 0
难道没有人用过吗? :(Top




