Hi Andrew,
What's wrong with my ticks?
hAxis: {
format:'h:mm aa',
ticks: [
[0, 0, 0, 0], [1, 0, 0, 0], [2, 0, 0, 0], [3, 0, 0, 0], [4,
0, 0, 0], [5, 0, 0, 0], [6, 0, 0, 0], [7, 0, 0, 0], [8, 0, 0, 0], [9, 0, 0,
0], [10, 0, 0, 0], [11, 0, 0, 0],
I got it working. However, one last thing I need to fix are the hour values
in the tool tip. It's showing military time. The hour values though in the
axis are displayed correctly.
Here is a screenshot where I clicked one of the points. it's showing 19:00
rather than 7pm.
You have to format the timeofday column. There are no built-in formatters
for the timeofday data type, but you can hijack the DateFormatter for the
purpose:
var formatter = new google.visualization.DateFormat({pattern: 'h:mm a'});
var timeSteps = ['hours', 'minutes', 'seconds',
You need to specify the hAxis.ticks option. The ticks option takes an
array of values or object. Values point to the location where a tick mark
(and label) should be placed. Objects have v (required) and f
(optional) properties, where v is the value to place a tick mark at, and
f is the
Awesome! I'll try it soon! :)
Thanks!
On Monday, August 4, 2014 6:57:49 PM UTC-5, Andrew Gallant wrote:
You need to specify the hAxis.ticks option. The ticks option takes an
array of values or object. Values point to the location where a tick mark
(and label) should be placed. Objects
It worked Andrew and it looks beautiful! :)
Will it work for dates? If so, what would be the values of ticks?
--
You received this message because you are subscribed to the Google Groups
Google Visualization API group.
To unsubscribe from this group and stop receiving emails from it, send an
Yes, it will works for dates, just use Date objects instead of the
timeofday arrays:
hAxis: {
ticks: [new Date(2014, 7, 1), new Date(2014, 7, 2), new Date(2014, 7,
3), new Date(2014, 7, 4)]
}
On Monday, August 4, 2014 8:12:05 PM UTC-4, Neil Camara wrote:
It worked Andrew and it looks
Cool! I'll try that later. :)
Thanks again!
On Monday, August 4, 2014 7:19:22 PM UTC-5, Andrew Gallant wrote:
Yes, it will works for dates, just use Date objects instead of the
timeofday arrays:
hAxis: {
ticks: [new Date(2014, 7, 1), new Date(2014, 7, 2), new Date(2014, 7,
3), new