你好,我刚刚意识到我的谷歌图表,但我想修改它。
- 我想改变日期显示,我想要一些更可读的东西。
- 我想反转图表
- 我想/10风速
你能帮我吗?谢谢。
图形最后24小时
<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',
legend: { position: 'bottom' }
};
var chart = new google.visualization.LineChart(document.getElementById('curve_chart'));
chart.draw(data, options);
}
我找到问题2的答案了:在hAxis中,我只需要将值修改为-1。
hAxis: { direction: -1,
textStyle: {
color:'white',
}},
vAxis: {
textStyle: {
color:'white',
}},