<?PHP/*Column Chart*/ #引入库文件 include(".. /class/pdata.class.php "); include(".. /class/pdraw.class.php "); include(".. /class/pimage.class.php "); #创建数据对象 $MyData=NewPData (); $MyData->addpoints (Array(150,220,300,-250,-420,-200,300,200,100), "Server A"); $MyData->addpoints (Array(140,0,340,-300,-320,-300,200,100,50), "Server B"); $MyData->setaxisname (0, "Hits"); $MyData->addpoints (Array("January", "February", "March", "April", "may", "Juin", "July", "August", "September"), "Months"); $MyData->setseriedescription ("Months", "Month"); $MyData->setabscissa ("Months"); #创建图形对象 $myPicture=NewPimage (700,230,$MyData); #关闭平滑模式 $myPicture->antialias =FALSE; #增加边框 $myPicture->drawgradientarea (0,0,700,230,direction_vertical,Array("Startr" =>240, "STARTG" =>240, "STARTB" =>240, "Endr" =>180, "ENDG" =>180, "Endb" =>180, "Alpha" = 100)); $myPicture->drawgradientarea (0,0,700,230,direction_horizontal,Array("Startr" =>240, "STARTG" =>240, "STARTB" =>240, "Endr" =>180, "ENDG" =>180, "Endb" =>180, "Alpha" = 20)); $myPicture->drawrectangle (0,0,699,229,Array("R" =>0, "G" =>0, "B" =>0)); #设置默认字体 $myPicture->setfontproperties (Array("FontName" and "=". /fonts/pf_arma_five.ttf "," FontSize "=>6)); #定义图像区域 $myPicture->setgrapharea (60,40,650,200); #设置比例 $scaleSettings=Array("Gridr" =>200, "GRIDG" =>200, "Gridb" =>200, "drawsubticks" =TRUE, "cyclebackground" =TRUE); $myPicture->drawscale ($scaleSettings); #设置图例 $myPicture->drawlegend (580,12,Array("Style" =>legend_noborder, "Mode" = =legend_horizontal)); #设置阴影 $myPicture->setshadow (TRUE,Array("X" =>1, "Y" =>1, "R" =>0, "G" =>0, "B" =>0, "Alpha" =>10)); #画图表 $myPicture->setshadow (TRUE,Array("X" =>1, "Y" =>1, "R" =>0, "G" =>0, "B" =>0, "Alpha" =>10)); $settings=Array("Surrounding" =>-30, "innersurrounding" =>30); $myPicture->drawbarchart ($settings); #递交图片 $myPicture->autooutput ("Pictures/example.drawbarchart.simple.png"); ?>
Pchart Chart Plug-in uses