Is it possible to insert a line break into the haxis, Horizontal Axis, label on google charts

3,293 views
Skip to first unread message

Steve Graham

unread,
Dec 6, 2013, 6:44:46 AM12/6/13
to google-visua...@googlegroups.com
I want to have the haxis labels split over two lines rather than on one line. I am guessing I want to add a line break into the haxis, horizontal axis text. Is this possible?

Instead of this:

  ¦                      ___
5 ¦                     /   \
  ¦                    /     \
4 ¦          ___      /       \
  ¦         /   \    /
3 ¦        /     \  /
  ¦       /       \/
2 ¦   ___
  ¦  /
1 ¦ /
  ¦/
  ________________________________________
    TUE 2nd  WED 3rd  THU 4th  FRI 5th 


I want to have this:

  ¦                      ___
5 ¦                     /   \
  ¦                    /     \
4 ¦          ___      /       \
  ¦         /   \    /
3 ¦        /     \  /
  ¦       /       \/
2 ¦   ___
  ¦  /
1 ¦ /
  ¦/
  ________________________________________
      TUE   WED   THU   FRI  SAT  SUN
      2nd   3rd   4th   5th  6th  7th

Thanks

asgallant

unread,
Dec 6, 2013, 11:05:14 AM12/6/13
to google-visua...@googlegroups.com
Use "\n" to create a line break.

Michał Sanokowski

unread,
Dec 7, 2013, 8:54:36 AM12/7/13
to google-visua...@googlegroups.com
doesn't work :(


[[' ','Liczba osób'],['TEST \n XXXXXXXXXXXX',5]]

asgallant

unread,
Dec 7, 2013, 12:00:13 PM12/7/13
to google-visua...@googlegroups.com
Ahh, I see. It looks like there is a bug with multiline labels on BarCharts.  It works fine for the other charts: http://jsfiddle.net/asgallant/g62Xs/

asgallant

unread,
Dec 7, 2013, 12:04:59 PM12/7/13
to google-visua...@googlegroups.com
I filed a bug report on this here: http://code.google.com/p/google-visualization-api-issues/issues/detail?id=1408.  You can "star" the issue to get updates on a fix.
Reply all
Reply to author
Forward
0 new messages