0

我正在绘制我测量的温度图。我认为使用 phplot 来绘制例如最后一天的温度图会很好。但是 phplot 从基础中提取每一条记录。有没有任何选项可以设置像 phplot 一样的东西可以每十个记录?我使用的代码很简单:

<?php
//Include the code
require_once 'phplot/phplot.php';

//Define the object
$plot = new PHPlot(800,400);

//Set titles
$plot->SetTitle("Wykres temperatury od czasu");
$plot->SetXTitle('Data');
$plot->SetYTitle('Temperatura');

mysql_connect("", "", "");
mysql_select_db("");
$query = mysql_query("SELECT data,temperatura FROM arduino ORDER BY data DESC LIMIT 3");

$data = array();

while ($row = mysql_fetch_assoc($query)) {
    $data[] = $row;
}

$plot->SetDataValues($data);

//Turn off X axis ticks and labels because they get in the way:
$plot->SetXTickLabelPos('none');
$plot->SetXTickPos('none');

//Draw it
$plot->DrawGraph();
?>
4

0 回答 0