AreaChart continuous hAxis formatting

17 views
Skip to first unread message

Kirollos Morkos

unread,
Feb 15, 2017, 3:53:26 PM2/15/17
to Google Visualization API
Hey all,

I am using a google charts AreaChart with dates along the x-axis (continuous hAxis). I want the format of the dates to show up as MM|dd|yyyy so I set my configuration options like so:

options = {
    ...
    hAxis: {
        format: "MM'|dd'|yyyy",
        ...
    }
    ....
}

When my chart loads, this formatting is ignored and the dates appear with arbitrary formatting depending on the range. How can I enforce the dates to follow my formatting?

Daniel LaLiberte

unread,
Feb 15, 2017, 4:09:55 PM2/15/17
to Google Visualization API
Sounds like you might be using the options to specify either a variable number of gridlines, or using the explorer mode.  In that case, since the range can vary considerably, you need to use a more advanced formatting option.  This is described briefly under "gridlines.units" on this page:


If this doesn't help, please provide a more complete example of what you are doing so the context is clear.

--
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/ede139cf-3acb-469f-b064-e05c01862f87%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

Kirollos Morkos

unread,
Feb 15, 2017, 5:00:17 PM2/15/17
to Google Visualization API
Wow, spot on! I was trying to turn off the explorer mode before by setting explorer: {actions: []} but I guess that didn't fully disable it. Removing the option altogether fixed it.
I wish I would have asked sooner, I spent so much time trying to figure this out, thank you so much!


On Wednesday, February 15, 2017 at 4:09:55 PM UTC-5, Daniel LaLiberte wrote:
Sounds like you might be using the options to specify either a variable number of gridlines, or using the explorer mode.  In that case, since the range can vary considerably, you need to use a more advanced formatting option.  This is described briefly under "gridlines.units" on this page:


If this doesn't help, please provide a more complete example of what you are doing so the context is clear.
On Wed, Feb 15, 2017 at 3:53 PM, Kirollos Morkos <kman...@gmail.com> wrote:
Hey all,

I am using a google charts AreaChart with dates along the x-axis (continuous hAxis). I want the format of the dates to show up as MM|dd|yyyy so I set my configuration options like so:

options = {
    ...
    hAxis: {
        format: "MM'|dd'|yyyy",
        ...
    }
    ....
}

When my chart loads, this formatting is ignored and the dates appear with arbitrary formatting depending on the range. How can I enforce the dates to follow my formatting?

--
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-visua...@googlegroups.com.



--
Reply all
Reply to author
Forward
0 new messages