Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- mysql_connect("localhost", "kühlschrank1","Wf8wVad5UMFtBGFD");
- mysql_select_db("kühlschrank1");
- $result = mysql_query("SELECT * FROM tbl_kuelschrank");
- // PHPlot Example: Simple line graph
- require_once 'phplot/phplot.php';
- $data = array();
- //mysql_connect("localhost", "Kühlschrank1", "Wf8wVad5UMFtBGFD");
- //mysql_select_db("kühlschrank1");
- //$querY = mysql_query("SELECT * FROM tbl_kühlschrank1");
- //$x = 0;
- //while($row = mysql_fetch_assoc($querry)){
- //$data[] = array('',$x,$row['temparature']);
- //x++;
- //}
- //$data = array(
- //array('mittags', 190, 178);
- //array('mittags', 190, 178);
- //array('mittags', 190, 178);
- //array('mittags', 10008, 178);
- //);
- $x = 0;
- global $X;
- while($row = mysql_fetch_assoc($result)){
- $data[] = array('$x','mittag', $row['Kühlschrank1']);
- }
- // array('0:00Uhr', 1800, 5,8,9,10), array('', 1810, 7), array('', 1820, 10),
- // array('1:00Uhr', 1830, 13), array('', 1840, 17), array('', 1850, 23),
- // array('2:00Uhr', 1860, 31), array('', 1870, 39), array('', 1880, 50),
- // array('3:00Uhr', 1890, 63), array('', 1900, 76), array('', 1910, 92),
- // array('4:00Uhr', 1920, 106), array('', 1930, 123), array('', 1940, 132),
- // array('5:00Uhr', 1950, 151), array('', 1960, 179), array('', 1970, 203),
- // array('6:00Uhr', 1980, 227), array('', 1990, 249), array('', 2000, 281,11,12,13),
- $plot = new PHPlot(1800, 600);
- $plot->SetImageBorderType('plain');
- $plot->SetPlotType('lines');
- $plot->SetDataType('data-data');
- $plot->SetDataValues($data);
- # Main plot title:
- $plot->SetTitle('IAS Kuehlschrankdiagramm Zentrum NRW West');
- $plot->SetXTitle('Tageszeit');
- $plot->SetYTitle('Temperatur');
- $plot->SetLegend(array('Kuelschrank1_Duesseldorf', 'Kuelschrank2_Duesseldorf','Kuelschrank1_Duisburg','Kuelschrank2_Duisburg'));
- # Make sure Y axis starts at 0:
- $plot->SetPlotAreaWorld(NULL, NULL, NULL, NULL);
- $plot->DrawGraph();
- ?>
Add Comment
Please, Sign In to add comment