Jacob, Apparently, we don't have enough formatting control over that particular way of generating tick labels. You have a couple choices though.
* You can specify the exact set of tick values and how you want them formatted with the 'ticks' option. See hAxis.ticks on https://developers.google.com/chart/interactive/docs/gallery/linechart * You can specify a very different way of generating ticks with gridlines: { count: -1 } combined with 'units' formatting, as mentioned on https://developers.google.com/chart/interactive/docs/datesandtimes#formatting-axis-gridline-and-tick-labels and demonstrated in this jsfiddle: https://jsfiddle.net/dlaliberte/fvj7a189/ On Mon, Aug 10, 2015 at 9:06 PM, Jacob Quisenberry < [email protected]> wrote: > > I am using the Google Visualization API to display an area chart. The > x-axis is of type 'datetime', and the y-axis is of type 'number'. When I > display times, times are displayed in the specified time zone in the tool > tips of the chart. Times are displayed in the time zone of the browser > along the hAxis. I would like to display the same times in both locations. > > First, I construct the DataTable using a for loop with this body. > > data.addRow([new Date(year + "-" + month + "-" + day + "T" + hour + ":" + > minute + ":" + second + "-05:00"), chartsdata[i].count]); > > One of the strings is "2014-02-10T10:00:00-05:00". I would like both the > tooltip and the hAxis to display "2014.02.10 10:00 -0500". > > To format times in the tooltips, I use this code: > > var formatter_long = new google.visualization.DateFormat({pattern: "yyyy.MM.dd > HH:mm ZZZ", timeZone: -5 }); > formatter_long.format(data, 0); > > > To display times along the hAxis, I use this code: > > hAxis: { slantedText: true, slantedTextAngle: 60, textStyle: { color: > 'green' }, format: 'yyyy.MM.dd HH:mm ZZZ', timeZone: -5, textStyle: { > fontSize:10} }, > > > I have not found a property of hAxis to specify the time zone. The result > is that > Tooltip time = 2014.02.10 10:00 -0500 > hAxis time = 2014.02.10 07:00 -0800 > > In other words, the tooltip is correct, but the hAxis labels are not. How > can I resolve this mismatch? > > > Thank you. > > -- > 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. > -- Daniel LaLiberte <https://plus.google.com/100631381223468223275?prsrc=2> - 978-394-1058 [email protected] <[email protected]> 5CC, Cambridge MA [email protected] <[email protected]> 9 Juniper Ridge Road, Acton MA -- 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.
