About haxis

84 views
Skip to first unread message

Ji Joe

unread,
Aug 29, 2012, 2:29:21 AM8/29/12
to google-visua...@googlegroups.com
Hi, I have a problem about horizontal axis. My work is to draw a candlesticks chart that shows the datas of the stock. The scale of the haxis is date, but on saturday and sunday ,the data is null. So  i used the option view to transmit column 0's type  date to string,and the chart can show  continuously.
But the texts in the axis are hiden and there are no gridline in the chart .
Thanks a lot.    

asgallant

unread,
Aug 29, 2012, 12:04:13 PM8/29/12
to google-visua...@googlegroups.com
When using a discrete axis (which is what you get when you use strings for the axis values), you cannot have gridlines.

You can't directly choose how many axis labels show up, but you can play around with hAxis.slantedText/slantedTextAngle/maxAlternation/maxTextLines/minTextSpacing/showTextEvery options to try and get what you want.

Ji Joe

unread,
Aug 30, 2012, 3:35:37 AM8/30/12
to google-visua...@googlegroups.com
Thank you for your advise.I used showTextEvery option to show the lable and a little hard to control the number of them,especially when add chartRangeFilter function .
Besides  my chart is too ugly without gridlines.Are there any other method to show gridlines?

在 2012年8月30日星期四UTC+8上午12时04分13秒,asgallant写道:

asgallant

unread,
Aug 30, 2012, 11:49:09 AM8/30/12
to google-visua...@googlegroups.com
You can make something like gridlines using domain-axis annotations.  Here's an example: http://jsfiddle.net/asgallant/pHrCC/ 
Reply all
Reply to author
Forward
0 new messages