学****phpjpgraph教程12007-08-1521:58首先包含进来jpgraph的类库:include("../");include("../");include("../");设置显示的数据数组;调用类库//设置图像的大小$graph=newGraph(400,200,"auto");$graph->SetScale("textlin");//设置图形的边距$graph->img->SetMargin(40,180,40,40);//设置图形的背景图片,填充方式有:BGIMG_FILLPLOT,BGIMG_FILLFRAME,BGIMG_COPY$graph->SetBackgroundImage("",BGIMG_FILLPLOT);$graph->img->SetAngle(45);//设置图形在图像中的角度//设置背景图片的对比度,mustbebetween-1<=x<=1,(0,0)=originalimage$graph->AdjBackgroundImage(0,0);//设置投影;//$graph->SetShadow();//设置标题$graph->title->Set("testimage");//设置标题字体样式$graph->title->SetFont(FF_FONT1,FS_BOLD);//设置标题的边距$graph->title->SetMargin(3);//设置图列的位置$graph->legend->Pos(,,"right","center");//设置图列的投影,颜色$graph->legend->SetShadow('******@');$graph->legend->SetFillColor('******@');//设置x轴的标记$graph->xaxis->SetTickLabels($label_x);//设置X轴的显示值的角度;$graph->xaxis->SetLabelAngle(30);//设置x轴标题和字体颜色$graph->xaxis->title->Set('Year2006');$graph->xaxis->title->SetFont(FF_FONT1,FS_BOLD);$graph->xaxis->title->SetColor('white');//设置x轴的字体和颜色$graph->xaxis->SetFont(FF_FONT1,FS_BOLD);$graph->xaxis->SetColor('yellow');//设置y轴的字体和颜色$graph->yaxis->SetFont(FF_FONT1,FS_BOLD);$graph->yaxis->SetColor('yellow');//设置是否显示格子。默认为显示;//$graph->ygrid->Show(false);//设置格子的颜色和粗细。值越小,格子越粗。$graph->ygrid->SetColor('******@');//设置y轴更优美一些$graph->yaxis->scale->SetGrace(20);学****phpjpgraph教程22007-08-1521:5
学习php-jpgraph教程 来自淘豆网www.taodocs.com转载请标明出处.