Part of Slepp's ProjectsPastebinTURLImagebinFilebin
Feedback -- English French German Japanese
Create Upload Newest Tools Donate
Sign In | Create Account

Advertising

Anonymous
Monday, January 18th, 2016 at 2:34:55pm UTC 

  1. <?
  2. include("Library/class/pData.class.php");
  3. include("Library/class/pDraw.class.php");
  4. include("Library/class/pImage.class.php");
  5. /*se crean los datos*/
  6. $MyData = new pData();
  7. $MyData->ImportFromCSV("temp_dia1.csv",",",2,TRUE,0);
  8. $MyData->setAxisName(0,"Temp/Hum");
  9. $MyData->setAbscissa("TimeStamp");
  10. $MyData->setXAxisDisplay(AXIS_FORMAT_TIME,"HH:MM");
  11. $MyData->AddAllSeries();
  12. $myData->SetAbsciseLabelSerie();
  13.  
  14. /* Create the pChart object */
  15. $myPicture = new pImage(700,230,$MyData);
  16. /* Turn of Antialiasing */
  17. $myPicture->Antialias = FALSE;
  18. /* Add a border to the picture */
  19. $myPicture->drawRectangle(0,0,699,229,array("R"=>0,"G"=>0,"B"=>0));
  20.  /* Write the chart title */
  21. $myPicture->setFontProperties(array("FontName"=>"Library/fonts/Forgotte.ttf","FontSize"=>11));
  22. $myPicture->drawText(150,35,"Average temperature",array("FontSize"=>20,"Align"=>TEXT_ALIGN_BOTTOMMIDDLE));
  23.  /* Set the default font */
  24. $myPicture->setFontProperties(array("FontName"=>"Library/fonts/pf_arma_five.ttf","FontSize"=>6));
  25.  /* Define the chart area */
  26. $myPicture->setGraphArea(60,40,650,200);
  27.  /* Draw the scale */
  28. $scaleSettings = array("XMargin"=>10,"YMargin"=>10,"Floating"=>TRUE,"GridR"=>200,"GridG"=>200,"GridB"=>200,"DrawSubTicks"=>TRUE,"CycleBackground"=>TRUE)
  29. $myPicture->drawScale($scaleSettings);
  30.  /* Turn on Antialiasing */
  31. $myPicture->Antialias = TRUE;
  32.  /* Draw the line chart */
  33. $myPicture->drawLineChart();
  34.  /* Write the chart legend */
  35. $myPicture->drawLegend(540,20,array("Style"=>LEGEND_NOBORDER,"Mode"=>LEGEND_HORIZONTAL));
  36. /* Render the picture (choose the best way) */
  37. $myPicture->autoOutput("pictures/example.drawLineChart.simple.png");
  38. ?>

advertising

Update the Post

Either update this post and resubmit it with changes, or make a new post.

You may also comment on this post.

update paste below
details of the post (optional)

Note: Only the paste content is required, though the following information can be useful to others.

Save name / title?

(space separated, optional)



Please note that information posted here will expire by default in one month. If you do not want it to expire, please set the expiry time above. If it is set to expire, web search engines will not be allowed to index it prior to it expiring. Items that are not marked to expire will be indexable by search engines. Be careful with your passwords. All illegal activities will be reported and any information will be handed over to the authorities, so be good.

comments powered by Disqus
worth-right