Guest User

Untitled

a guest
May 27th, 2016
33
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php
  2. mysql_connect("localhost", "kühlschrank1","Wf8wVad5UMFtBGFD");
  3. mysql_select_db("kühlschrank1");
  4. $result = mysql_query("SELECT * FROM tbl_kuelschrank");
  5. // PHPlot Example: Simple line graph
  6. require_once 'phplot/phplot.php';
  7. $data = array();
  8. //mysql_connect("localhost", "Kühlschrank1", "Wf8wVad5UMFtBGFD");
  9. //mysql_select_db("kühlschrank1");
  10. //$querY = mysql_query("SELECT * FROM tbl_kühlschrank1");
  11. //$x = 0;
  12. //while($row = mysql_fetch_assoc($querry)){
  13. //$data[] = array('',$x,$row['temparature']);
  14. //x++;
  15.  
  16. //}
  17. //$data = array(
  18. //array('mittags', 190, 178);
  19. //array('mittags', 190, 178);
  20. //array('mittags', 190, 178);
  21. //array('mittags', 10008, 178);
  22.  
  23.  
  24. //);
  25. $x = 0;
  26.  
  27. global $X;
  28. while($row = mysql_fetch_assoc($result)){
  29. $data[] = array('$x','mittag', $row['Kühlschrank1']);
  30. }
  31.  
  32.  
  33. // array('0:00Uhr', 1800, 5,8,9,10), array('', 1810, 7), array('', 1820, 10),
  34. // array('1:00Uhr', 1830, 13), array('', 1840, 17), array('', 1850, 23),
  35. // array('2:00Uhr', 1860, 31), array('', 1870, 39), array('', 1880, 50),
  36. // array('3:00Uhr', 1890, 63), array('', 1900, 76), array('', 1910, 92),
  37. // array('4:00Uhr', 1920, 106), array('', 1930, 123), array('', 1940, 132),
  38. // array('5:00Uhr', 1950, 151), array('', 1960, 179), array('', 1970, 203),
  39. // array('6:00Uhr', 1980, 227), array('', 1990, 249), array('', 2000, 281,11,12,13),
  40.  
  41. $plot = new PHPlot(1800, 600);
  42. $plot->SetImageBorderType('plain');
  43. $plot->SetPlotType('lines');
  44. $plot->SetDataType('data-data');
  45. $plot->SetDataValues($data);
  46. # Main plot title:
  47. $plot->SetTitle('IAS Kuehlschrankdiagramm Zentrum NRW West');
  48. $plot->SetXTitle('Tageszeit');
  49. $plot->SetYTitle('Temperatur');
  50. $plot->SetLegend(array('Kuelschrank1_Duesseldorf', 'Kuelschrank2_Duesseldorf','Kuelschrank1_Duisburg','Kuelschrank2_Duisburg'));
  51. # Make sure Y axis starts at 0:
  52. $plot->SetPlotAreaWorld(NULL, NULL, NULL, NULL);
  53. $plot->DrawGraph();
  54.  
  55.  
  56. ?>
Add Comment
Please, Sign In to add comment