Merci
Code : Tout sélectionner
<script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(graph24h);
function graph24h() {
var data = google.visualization.arrayToDataTable([
['Date', 'Température', 'Vent Moyen', 'Humidité'],
<?php
$chartQuery = "SELECT * FROM ZiMeteo ORDER BY ID DESC LIMIT 144";
$chartQueryRecords = mysqli_query($connect, $chartQuery);
while ($row = mysqli_fetch_assoc($chartQueryRecords)) {
echo "['".$row['Date']."',".$row['TmpExt'].",".$row['Vents'].",".$row['HumExt']."],";
}
?>
]);
var options = {
title: 'Evolution sur 24 h',
titleColor: 'white',
backgroundColor: 'transparent',
color: ['white'],
hAxis: { direction: -1,
format:'MMM d, y',
textStyle: {
color:'white'
},
},
vAxis: {
textStyle: {
color:'white',
}},
chartArea: {left : 100,
width: 1000},
legend: { position: 'center',
textStyle: {
color: 'white'},
}
};
var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));
chart.draw(data, options);
}
</script>