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.