Unsupported PHP script for displaying weight data over time
Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?PHP
  2. require('data.php');
  3. $tenp = array(123.4, 123.4);
  4. $twen = array(111.1, 111.1);
  5. $obe2 = array(113.4, 113.4);
  6. $over = array(97.2, 97.2);
  7. $norm = array(81, 81);
  8. $morb = array(129.6, 129.6);
  9. $lall = array(0, count($data));
  10. include ('jpgraph/src/jpgraph.php');
  11. include ('jpgraph/src/jpgraph_line.php');
  12. $graph = new Graph(800, 800, 'weight.png');
  13. $graph->setMargin(50, 50, 50, 50);
  14. $graph->legend->setPos(0.03, 0.1);
  15. $graph->title = new Text('Mass against time');
  16. $graph->title->align('center');
  17. $graph->title->setFont(FF_FONT2);
  18. $graph->title->setMargin(10);
  19. $line = new LinePlot($data);
  20. $line->mark->show();
  21. $line->mark->setType(MARK_UTRIANGLE);
  22. $graph->add($line);
  23. $graph->setscale('textlin', 78, 140, 0, count($data));
  24. $graph->setY2Scale('lin', 78.0 / (1.8*1.8), 140.0 / (1.8*1.8));
  25. $graph->ygrid->show(false);
  26. $graph->y2grid->show(true, true);
  27. $graph->xaxis->setTitle('Week number', 'middle');
  28. $graph->xaxis->setTitleMargin(15);
  29. $graph->yaxis->setTitle('Mass (KG)', 'middle');
  30. $graph->yaxis->setTitleMargin(32);
  31. $graph->y2axis->setTitle('BMI', 'middle');
  32. $graph->y2axis->setTitleMargin(30);
  33. $graph->stroke();
  34. ?>