Changing x-axis label to show year and quarter for Google Visualization Bubble chart

1,466 views
Skip to first unread message

Dan Bergman

unread,
Feb 7, 2013, 10:44:05 AM2/7/13
to google-visua...@googlegroups.com
 

I'm trying to have the x-axis on my Bubble chart display its label values in quarters such as "Q1 FY13", similiar to the charts axis as shown:

Quarter demo

In the API they mentioned using a domain column in the datatable as the role where you could then specify a string such as 'Q1/09' (https://developers.google.com/chart/interactive/docs/roles),

role:  domain,   data,       data,   domain,   data,     data
      'Q1/09',   1000,        400,  'Q1/08',    800,      300
 

But from what I can tell this seems to be restricted by the type of chart you use, and bubble charts first column has to be a number.

This is a picture of what I have currently, using quarters as the axis, but alas you can't tell what year you're looking at...

enter image description here

So does anyone know if this possible? If not, is there another workaround I could do to show these labels?

asgallant

unread,
Feb 7, 2013, 3:11:05 PM2/7/13
to google-visua...@googlegroups.com
You can format the axis labels as quarters if you use a "date" axis (support for date axes is not listed in the documentation, but it works): http://jsfiddle.net/asgallant/m5bsr/

down.with.the.bass

unread,
Feb 8, 2013, 8:25:18 AM2/8/13
to google-visua...@googlegroups.com
Simply perfect - thanks asgallant for showing me this :)

asgallant

unread,
Feb 8, 2013, 10:34:30 AM2/8/13
to google-visua...@googlegroups.com
You're welcome.
Reply all
Reply to author
Forward
0 new messages