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.
Thank you