Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

181
Views
Google Chart change vAxis value

I am trying to make a Google Chart. My data are taken from a MYSQL database. On vAxis i wanted to show time duration. For example a time duration like that: 4:40,85 That means 4 minutes and 40 seconds and 85 hundreds.

My solution was to turn the time duration at hundreds (of second), put it in a different column in database and show them at the Graph.

I did it but the problem is that i want to show at the axis value the original format (4:40,85) and not the hundreds (e.g. 6850)

The code i used is that below:

function drawChart() {
    var data_val = google.visualization.arrayToDataTable([

        ['Date', 'huns of secs'],
        <?php
        $select_query = "SELECT * FROM records WHERE id_Race='10' GROUP BY date_record ORDER BY date_record ";

        $query_result = mysqli_query($connection, $select_query);
        while ($row_val = mysqli_fetch_array($query_result)) {

            echo "['" . $row_val['date_record'] . "'," . $row_val['total_huns'] . "],";

        }
        ?>

    ]);

    var wrapper = new google.visualization.ChartWrapper({
        chartType: 'LineChart',
        dataTable: data_val,
        options: {
            'legend': 'bottom',
            'colors': ['#D70005'], 
            'chartArea': {left: 100, top: 10, width: 450}, 
            'vAxis': {
                format: '#,###', 
                'viewWindow': {max: 20000, min: 0},
                title: 'Hundreds'
            },
            'hAxis': {
                title: 'Date'
            },
            'pointSize': 6},
        containerId: 'columnchart'
    });

    wrapper.draw();
}

How can i turn hundreds (of second) in normal time duration format (4:40,85) and show that value instead of hundreds.

enter image description here

Thank you

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!