1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
|
<?php
include('jpgraph.php');
include('jpgraph_date.php');
include('jpgraph_regstat.php');
include('jpgraph_line.php');
function FormatXLabel($valeur)
{
return date("H:i\nd/m",$valeur);
}
function FormatYLabel($valeur)
{
return sprintf("%01.1f",$valeur);
}
//----------------------------------------------------------------------------------------------------
$ventvitesse_datax = array(1219282980, 1219283040, 1219283100, 1219283160, 1219283220, 1219283280, 1219283340, 1219283400, 1219283460, 1219283520, 1219283580, 1219283640, 1219283700, 1219283760, 1219283820, 1219283880, 1219283940, 1219284000, 1219284060, 1219284120, 1219284180, 1219284240, 1219284300, 1219284360, 1219292340, 1219292400, 1219292460, 1219292520, 1219292580, 1219292640, 1219292700, 1219292760, 1219292820, 1219292880, 1219292940, 1219293000, 1219293060, 1219293120, 1219293180, 1219293240, 1219293300, 1219293360, 1219293420, 1219293480, 1219293540, 1219293600, 1219293660, 1219293720, 1219293780);
$ventvitesse_datay = array(2.52, 2.52, 0, 3.96, 0, 0, 2.52, 0, 0, 0, 0, 0, 0, 3.96, 1.08, 3.24, 1.8, 0, 0, 0, 1.44, 2.52, 1.44, 0, 4.68, 3.24, 0, 7.56, 3.96, 13.68, 3.24, 7.56, 2.88, 6.48, 7.56, 2.88, 5.4, 3.6, 3.24, 2.52, 2.52, 2.16, 2.52, 4.68, 4.68, 6.48, 0, 5.04, 22.68);
//----------------------------------------------------------------------------------------------------
$ventvitesse = new Graph(540,350);
$ventvitesse->SetAlphaBlending();
$ventvitesse->SetFrame(true,'white',1);
$ventvitesse->SetMarginColor('white');
$ventvitesse->SetMargin(65,5,45,75);
$ventvitesse->SetScale("datlin");
$ventvitesse->xaxis->SetLabelFormatCallback('FormatXLabel');
$ventvitesse->xaxis->SetTextLabelInterval(2);
$ventvitesse->xaxis->SetPos('min');
$ventvitesse->xgrid->Show();
$ventvitesse->xaxis->scale->SetTimeAlign(MINADJ_1);
$ventvitesse->yaxis->SetLabelFormatCallback('FormatYLabel');
$ventvitesse->yaxis->title->Set("Vitesse du Vent (km/h)");
$ventvitesse->yaxis->SetTitleMargin(50);
$ventvitesse_spline = new Spline($ventvitesse_datax,$ventvitesse_datay);
list($ventvitesse_newx,$ventvitesse_newy) = $ventvitesse_spline->Get(50);
$ventvitesse_courbe = new LinePlot($ventvitesse_newy,$ventvitesse_newx);
$ventvitesse_courbe->SetColor('dodgerblue');
$ventvitesse_courbe->SetFillColor('dodgerblue@0.4');
$ventvitesse->Add($ventvitesse_courbe);
$ventvitesse->Stroke();
?> |
Partager