javascript - CONVERT TIMES in HighChart -


i using high charts compare waiting time discharge times each patient.

for example:

patient id   expected time    waiting time 2            2 hours          1 hour  

i have connection database these times:

$query2 = "select patientid,forename, patient.illness, patient.priority, arrival_time, my_time() now, abs( timediff( my_time( ) , arrival_time ) ) waiting_time, time_to_sec( expected_time) expected_time , time_to_sec( discharge_time )  discharge_time, examined patient, priority_time patient.illness = priority_time.illness , patient.priority = priority_time.priority;"; $result2 = mysqli_query($conn, $query2) or die("invalid query: ".$query2);  

i want display patient id on x axis , waiting time on y axis.

issues:

converting time display in format: hours: minutes: seconds on y axis. 

here code:

<html>     <head>     <script src="http://code.jquery.com/jquery-1.7.1.min.js"></script>     <script src="js/highcharts.js"></script>     <script type="text/javascript">         function drawchart(){             var chart = new highcharts.chart({                 chart: {                     renderto: 'divforchart',                     type:'column',                 },                 xaxis: {                     name:'patients',                     categories: ['juan','pepe','paco']                 },                 yaxis: {                     type: 'datetime'                 },                  series: [                     {                         name: 'arrival time',                         data: [                             ['juan',date.utc(2012,4,18,11,0)],                              ['pepe',date.utc(2012,4,18,11,0)],                              ['paco',date.utc(2012,4,18,11,0)]                          ]                     },                     {                         name: 'expected time',                         data: [                             ['juan',date.utc(2012,4,18,12,00)],                              ['pepe',date.utc(2012,4,18,13,00)],                              ['paco',date.utc(2012,4,18,11,15)]                         ]                     }                 ]             });         }     </script>     </head>     <body onload="drawchart()">      <div id="divforchart" style="height: 400px"></div>     </body> 

edit: visualization


Comments

Popular posts from this blog

Why does Ruby on Rails generate add a blank line to the end of a file? -

keyboard - Smiles and long press feature in Android -

node.js - Bad Request - node js ajax post -