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 label to place there; if "f" is not specified, the axis should
format the value according to the format option. Using the ticks option
overrides all other options for controlling the axis tick marks - the only
tick marks that will appear are those you specify, regardless of anything
else in the chart.
Assuming you are using a "timeofday" column for your times, it would look
like this:
hAxis: {
format: 'h:mm aa',
ticks: [[1, 0, 0, 0], [2, 0, 0, 0], [3, 0, 0, 0], [4, 0, 0, 0], [5, 0,
0, 0], [6, 0, 0, 0]]
}
On Monday, August 4, 2014 5:32:17 PM UTC-4, Neil Camara wrote:
>
> For example, the data I received is { hour : 2:00, totalcount : 10 }, only
> 1 data.
>
> What I'd like Google Charts to do is display like 6 hours in the x-axis
>
> like 1:00 2:00 3:00 4:00 5:00 3:00
>
> of course, my column totalcount data will only appear above 2:00.
>
> I tried the code below but Google Charts is displaying values for
> different time of data. Sometimes it will display with the 30th minute
> which I don't want.
>
> hAxis: { format:'h:mm aa',
> "gridlines": {
> "count": 6
> }
> },
>
> When my data starts at 12am, it only display 12am.
>
> What is the solution to this?
>
> Thanks!
>
--
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 email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-visualization-api.
For more options, visit https://groups.google.com/d/optout.