Hallo Leute,
ich bin echt am Verzweifeln, jetzt hat´s endlich geklappt ein paar Temperaturen zu plotten, aber die Beschriftung der x-Achse funktioniert einfach nicht richtig.
PHP
<?php
# PHPlot Example: Simple line graph
require_once 'phplot/phplot.php';
$data = array();
$con= mysqli_connect("localhost", "Leo", "raspberry", "haus");
$sql = "SELECT * FROM tab_Heizung"; //ORDER BY datet$
$rs = mysqli_query($con, $sql);
$totalRows_rs = mysqli_num_rows($rs);
$x = 0;
//Schleife zur Auflistung der Datensaetze
while ($row = mysqli_fetch_assoc($rs))
{
$data[] = array('', $x, $row["t_HZ_SPEICH"], $row["t_HZ_VL"], $row["t_HZ_RL"]);
$x++;
}
$plot = new PHPlot(800, 600);
$plot->SetImageBorderType('none');
$plot->SetPlotType('lines');
$plot->SetDataType('data-data');
$plot->SetDataValues($data);
$plot->SetTitle('Temperatur Heizungsspeicher');
$plot->SetXTitle('Datum Uhrzeit');
$plot->SetYTitle('Temp in Celsius');
$plot->SetLegend(array('Speicher', 'Vorlauf', 'Ruecklauf'));
$plot->SetPlotAreaWorld(NULL, NULL, NULL, NULL);
$plot->SetXLabelType ('time', '%H:%M:%S-%d.%m.%Y');
$plot->SetXLabelAngle(90);
//$plot->SetXTimeFormat (%Y-%m-%d.%H:%M:%S);
$plot->DrawGraph();
?>
Alles anzeigen
ergibt:
als Datenquelle ist:
deklariert.
Wie bekomme ich die Varieblen der "datetime" als X-Achsen-Beschriftung?
Danke schon mal und Gruß
Leo