How to modify google chart?

Viewed 22

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. i d like to reverse the chart
  3. i d like to /10 wind speed

Can you help me ? Thanks.

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);
  }
1 Answers

i find answer for question 2 : in the hAxis i just have to modifiy the value to -1.

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