Pchart Chart Plug-in uses

Source: Internet
Author: User

<?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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.