Guest User

Untitled

a guest
Nov 9th, 2019
127
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $rezultat = mysqli_query($polaczenie, "SELECT * FROM pomiary") or die ("Błąd zapytania do bazy: $dbname");
  2. $d=0;
  3. $X1 = $wiersz[1];
  4. $X2 = $wiersz[2];
  5. $X3 = $wiersz[3];
  6. $X4 = $wiersz[4];
  7. $X5 = $wiersz[5];
  8. while ($wiersz = mysqli_fetch_array ($rezultat)) {
  9. $data[$d][0] = '';
  10. $data[$d][1] = $l;
  11. $data[$d][2] = $X1;
  12. $data[$d][3] = $X2;
  13. $data[$d][4] = $X3;
  14. $data[$d][5] = $X4;
  15. $data[$d][6] = $X5;
  16. $d = $d+1;
  17. }
  18. $data[0][0] = 'Ostatni';
  19. $data[$d-1][0] = "Aktualny";
  20.  
  21. mysqli_query($polaczenie, "SELECT x1,x2,x3,x4,x5 FROM pomiary");
  22.  
  23.  
  24. require_once 'phplot.php';
  25. $plot = new PHPlot(600, 500);
  26. $plot -> SetImageBorderType('plain');
  27. $plot -> SetPlotType('lines');
  28. $plot -> SetDataType('data-data');
  29. $plot -> SetDataValues($data);
  30. # Tytuł głównego wykresu:
  31. $plot -> SetTitle('Temperatura: ');
  32. $plot->SetLegend(array('X1', 'X2', 'X3', 'X4', 'X5'));
  33. $plot -> SetPlotAreaWorld(NULL, 0, NULL, NULL);
  34. $plot -> DrawGraph();
RAW Paste Data