max value in vaxis as date issue

9 views
Skip to first unread message

B. Rentrug

unread,
Dec 22, 2016, 7:39:37 AM12/22/16
to Google Visualization API
hi, 

i want to set a max value for vaxis as a date (e.g. today). but it does not work :( (see the print screen)

chart options look like this:

var options = {
chartArea: {left:50,top:10,width: '94%', height: '70%'},
vAxis: {minValue: 0, title: 'Reaktionszeit in sec', textStyle: {color: font_color, fontName: font_fam}, titleTextStyle: {color: font_color, fontName: font_fam}},

hAxis: {textStyle: {color: font_color, fontName: font_fam}, format: 'd.M.yy',lantedText:true, slantedTextAngle:270, showTextEvery:1
,minValue: new Date(2016,12,15)
,maxValue: new Date(2016,12,22)
}

}


can anyone help??
Bildschirmfoto 2016-12-22 um 10.35.36.png

Daniel LaLiberte

unread,
Dec 22, 2016, 8:32:38 AM12/22/16
to Google Visualization API
When you specify dates in JavaScript and most languages with numbers, the months start at 0.  So your new Date(2016, 12, 15) is actually wrapping around to Jan 15, 2017.

--
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 google-visualization-api+unsub...@googlegroups.com.
To post to this group, send email to google-visualization-api@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.
To view this discussion on the web visit https://groups.google.com/d/msgid/google-visualization-api/b51fce1f-9de0-4efa-824a-d21e90472814%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages