pchart的使用说明
<?php include("../class/pData.class.php"); include("../class/pDraw.class.php"); include("../class/pImage.class.php"); $myData = new pData(); //读入数据 $myData->addPoints(array(42,-36,-32,33,33,-43,46,-28),"Serie1");//读入数组中的数据,将这些数据赋予变量Serie1 $myData->setSerieDescription("Serie1","Serie 1");//给变量Serie1起一个名字,为了更好的说明Serie1数据的含义,Serie 1会显示在右上角 $myData->setSerieOnAxis("Serie1",0); //读入X轴数据 $myData->addPoints(array("January","February","March","April","May","June","July","August"),"Absissa"); $myData->setAbscissa("Absissa"); $myData->setAxisPosition(0,AXIS_POSITION_LEFT); $myData->setAxisName(0,"1st axis"); $myData->setAxisUnit(0,""); $myPicture = new pImage(1300,500,$myData,TRUE);//设置画布的大小 $Settings = array("R"=>0, "G"=>0, "B"=>0, "Dash"=>1, "DashR"=>20, "DashG"=>20, "DashB"=>20); $myPicture->drawFilledRectangle(0,0,1300,500,$Settings); //这里是对图标标题的设置 $myPicture->setFontProperties(array("FontName"=>"../fonts/Forgotte.ttf","FontSize"=>14)); $TextSettings = array("Align"=>TEXT_ALIGN_MIDDLEMIDDLE , "R"=>255, "G"=>255, "B"=>255); $myPicture->drawText(500,25,$title,$TextSettings);//设置图标的标题显示的位置,标题 //设置图标的大小 $myPicture->setGraphArea(50,50,1225,410); $myPicture->setFontProperties(array("R"=>255,"G"=>255,"B"=>255,"FontName"=>"../fonts/pf_arma_five.ttf","FontSize"=>6)); //对X轴的设置 $Settings = array("Pos"=>SCALE_POS_LEFTRIGHT , "Mode"=>SCALE_MODE_FLOATING , "LabelingMethod"=>LABELING_ALL , "GridR"=>255, "GridG"=>255, "GridB"=>255, "GridAlpha"=>50, "TickR"=>0, "TickG"=>0, "TickB"=>0, "TickAlpha"=>50, "LabelRotation"=>45, "LabelSkip"=>5, "CycleBackground"=>1, "DrawXLines"=>1, "DrawSubTicks"=>1, "SubTickR"=>255, "SubTickG"=>0, "SubTickB"=>0, "SubTickAlpha"=>50, "DrawYLines"=>ALL); //"LabelRotation"=>45 设置X轴点位的倾斜角度 "LabelSkip"=>5 设置5个间隔为一个周期 $myPicture->drawScale($Settings); $Config = ""; $myPicture->drawLineChart($Config); $Config = array("FontR"=>0, "FontG"=>0, "FontB"=>0, "FontName"=>"../fonts/pf_arma_five.ttf", "FontSize"=>6, "Margin"=>6, "Alpha"=>30, "BoxSize"=>5, "Style"=>LEGEND_NOBORDER , "Mode"=>LEGEND_HORIZONTAL ); $myPicture->drawLegend(863,16,$Config);//右上角的对折线的说明文字 $myPicture->stroke(); ?>