phpmyadmin 如何修改谷歌图表?

qoefvg9y  于 2022-11-09  发布在  PHP
关注(0)|答案(1)|浏览(131)

你好,我刚刚意识到我的谷歌图表,但我想修改它。
1.我想换一下日期显示。我想要更易读的。
1.我想把图表倒过来
1.我想/10风速
你能帮我吗?谢谢。
graphique last 24 h

<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);
  }
lymnna71

lymnna711#

我找到了问题2答案:在h轴中,我只需要将值修改为-1。

hAxis: { direction: -1,
                 textStyle: {
                    color:'white',
                 }},
                    vAxis: { 
                 textStyle: {
                    color:'white',
                 }},

相关问题