Timeline Chart - Keep the Mouseover info as hours and minutes, not days

76 views
Skip to first unread message

Rob Berry

unread,
Nov 23, 2016, 5:52:09 PM11/23/16
to Google Visualization API
Hello All,

I've been using a Timeline chart for a while now and very pleased with how it works but there's one slight problem that I believe you may be able to assist with.

It currently displays host uptime (based on an arpscan every 5 mins) and when there is a small time range in the chart, typically a few days worth, the X Axis shows time (in hours) and when mouse I over an item on the chart, it shows the times and duration in hours and minutes e.g. 08:50am - 09:00am Duration: 10 mins.  When however the chart shows a greater period of time, the X Axis changes to display the date and mousing over the chart items shows the date and duration in days e.g. Nov 22 - 22, 2016 Duration: 1 Day.

As I would like the chart more granular, is there a way that I can force the X Axis (and the information when mousing over an item), to show the Hours and Minutes, rather than days?

Thanks for any assistance,
Rob.

Hima Bindu

unread,
Dec 29, 2016, 12:46:14 AM12/29/16
to Google Visualization API
I am also new, just learning. I think you can add  datatype.. 'timeofday' to your datatable, see the below sample.

eg:  var data = new google.visualization.datatable();
data.addColumns('timeofday', 'TimeStamp');   // datatype, column label
data.addColumns('number', 'Consumers');       // datatype, column label

data.addRows([11,22,22],[10]);  // [hours, min, sec] ,[consumers] 
data.addRows([22,22,22],[15]); 

var options ={} ;

var chart = new google.visualization.linechart(document.getelemntbyid("xx"));

chart.draw(data, options);
Reply all
Reply to author
Forward
0 new messages