简体   繁体   English

如何修改谷歌图表?

[英]How to modify google chart?

Hello i just realised my google chart but i'd like to modify it.您好,我刚刚意识到我的谷歌图表,但我想修改它。

  1. i'd like to change the date display i would like something more readable.我想更改日期显示我想要更具可读性的内容。
  2. id like to reverse the chart我喜欢反转图表
  3. id like to /10 wind speed我喜欢 /10 风速

Can you help me ?你能帮助我吗 ? Thanks.谢谢。

graphique last 24 h过去 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);
  }

i find answer for question 2 : in the hAxis i just have to modifiy the value to -1.我找到了问题 2 的答案:在 hAxis 中,我只需要将值修改为 -1。

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

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM