Re: Using custom Formatter to format vAxis text.

73 views
Skip to first unread message

asgallant

unread,
Nov 30, 2012, 2:38:10 PM11/30/12
to google-visua...@googlegroups.com
There is no way to do this in the API.

On Friday, November 30, 2012 12:38:59 PM UTC-5, snipka wrote:
Hello Everyone,

From the documentation I found that one can use vAxis:{ format: '...' } to format numbers that are displayed on vAxis as text.

However, I need to perform calculation (ICU pattern set doesn't cut it - tell me if I'm wrong). In my case - convert seconds (Integer), to HOURS:MINUTES:SECONDS.
I have a custom formatter that does that to format columns in google.visualization.DataTable and the formatted Integers are displayed in toolTip correctly.

Is there a way to apply custom formatter for vAxis? I tried `vAxis:{ format: new elapseTimeFormatter() }` - it didn't work.
If not, what would be an alternative/workaround to achieve the formatting describes above.


Thank you.

Dan Schnau

unread,
Sep 25, 2015, 4:28:48 PM9/25/15
to Google Visualization API
Sorry for the huge Necro.

I have this exact same problem. I understand the API doesn't really support it. Can anyone suggest a workaround?

Dan Schnau

unread,
Oct 6, 2015, 8:25:24 AM10/6/15
to Google Visualization API
In case anyone finds this in the future, we worked around this.

We were table to customize the vAxis format by dynamically generating an object for vAxis.ticks. We had to re-implement a few things you get with other formats for free but it worked out okay. 
Reply all
Reply to author
Forward
0 new messages