Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

183
Vistas
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
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda