<head>
<?php /* Include all the classes pChart*/ include("class/pDraw.class.php"); include("class/pImage.class.php"); include("class/pData.class.php"); ?>
</head>
<?php $myData = new pData(); // , . while (list($dt,$sum) = mysql_fetch_row($result)) { /* */ $myData->addPoints($sum,"Total"); $myData->addPoints($dt,"Labels"); }; $unique = date("Ymd_H.i"); $gsFilename_Traffic = "traffic_".$unique.".png"; $myData->setSerieDescription("Labels","Days"); $myData->setAbscissa("Labels"); $myData->setAxisUnit(0," KB"); $serieSettings = array("R"=>229,"G"=>11,"B"=>11,"Alpha"=>100); $myData->setPalette("Total",$serieSettings); $myPicture = new pImage(1250,400,$myData); // <-- $myPicture->setFontProperties(array("FontName"=>"fonts/tahoma.ttf","FontSize"=>8)); $myPicture->setGraphArea(50,20,1230,380); // <-- $myPicture->drawScale(); $myPicture->drawBestFit(array("Alpha"=>40)); // <-- $myPicture->drawLineChart(); $myPicture->drawPlotChart(array("DisplayValues"=>FALSE,"PlotBorder"=>TRUE,"BorderSize"=>0,"Surrounding"=>-60,"BorderAlpha"=>50)); // <-- $myPicture->drawLegend(700,10,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL));// <-- $myPicture->Render("pChartPic\\".$gsFilename_Traffic); ?>
<br /><h3></h3> <br /><IMG SRC="pChartPic/
<?php echo $gsFilename_Traffic; ?>
" />
Source: https://habr.com/ru/post/205532/
All Articles