SmallGraph.php 864 B

1234567891011121314151617181920212223242526272829
  1. <?php
  2. /*
  3. SmallGraph: Let's go fast, draw small!
  4. */
  5. // Standard inclusions
  6. include("src/pData.php");
  7. include("src/pChart.php");
  8. // Dataset definition
  9. $DataSet = new pData;
  10. $DataSet->AddPoint(array(1,4,-3,2,-3,3,2,1,0,7,4,-3,2,-3,3,5,1,0,7),"Serie1");
  11. $DataSet->AddAllSeries();
  12. $DataSet->SetAbsciseLabelSerie();
  13. $DataSet->SetSerieName("January","Serie1");
  14. // Initialise the graph
  15. $Test = new pChart(100,30);
  16. $Test->setFontProperties("Fonts/tahoma.ttf",8);
  17. $Test->drawFilledRoundedRectangle(2,2,98,28,2,230,230,230);
  18. $Test->setGraphArea(5,5,95,25);
  19. $Test->drawGraphArea(255,255,255);
  20. $Test->drawScale($DataSet->GetData(),$DataSet->GetDataDescription(),SCALE_NORMAL,220,220,220,FALSE);
  21. // Draw the line graph
  22. $Test->drawLineGraph($DataSet->GetData(),$DataSet->GetDataDescription());
  23. // Finish the graph
  24. $Test->Render("SmallGraph.png");