hAxis does not render correct date format for 1 UNIT

28 views
Skip to first unread message

prasyell7

unread,
Feb 15, 2018, 3:30:45 PM2/15/18
to Google Visualization API
I am using the following chart options.

      chartArea: { height: '80%', width: '90%' },
      hAxis: { slantedText: false, format: 'MMM,yy',
        gridlines: {
            count: -1,
            units: {
              months: {format: ['MMM,yy']}
            }
          },
          minorGridlines: {
          color: 'none',
          }
      },

H-Axis renders and displays correctly when there are multiple intervals, like months, years etc. But when there is only one unit (e.g one month), it displays times tamp on the h-axis. Both the pictures are attached.

I tried changing the format many ways, but still no luck, all the options are ignored by Google API.

Any idea?
Data_With_1Unit.PNG
Data_With_multiple_units.PNG

Daniel LaLiberte

unread,
Feb 15, 2018, 3:36:31 PM2/15/18
to Google Visualization API
I would recommend you try the 'upcoming' version.  There are many changes that might fix your problem.  In particular, you have an hAxis.format option that will probably be ignored in this context for the current version.

--
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/d416c713-c3b1-4835-a73c-537350fd386d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--

prasyell7

unread,
Feb 15, 2018, 3:40:37 PM2/15/18
to Google Visualization API
Thanks for the reply. Yes I tried dateFormat and other options as per the API Documentation. However all options are ignored and when I remove "format: 'MMM,yy', " it displays just years, like 2010, 2020, 2050 etc.

Also I am afraid to update the version as this is a bug and this application is already in Production.

On Thursday, February 15, 2018 at 3:36:31 PM UTC-5, Daniel LaLiberte wrote:
I would recommend you try the 'upcoming' version.  There are many changes that might fix your problem.  In particular, you have an hAxis.format option that will probably be ignored in this context for the current version.
On Thu, Feb 15, 2018 at 3:30 PM, prasyell7 <prasad....@gmail.com> wrote:
I am using the following chart options.

      chartArea: { height: '80%', width: '90%' },
      hAxis: { slantedText: false, format: 'MMM,yy',
        gridlines: {
            count: -1,
            units: {
              months: {format: ['MMM,yy']}
            }
          },
          minorGridlines: {
          color: 'none',
          }
      },

H-Axis renders and displays correctly when there are multiple intervals, like months, years etc. But when there is only one unit (e.g one month), it displays times tamp on the h-axis. Both the pictures are attached.

I tried changing the format many ways, but still no luck, all the options are ignored by Google API.

Any idea?

--
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.



--

Daniel LaLiberte

unread,
Feb 15, 2018, 3:44:32 PM2/15/18
to Google Visualization API
The 'upcoming' version will be changed to 'current' once it is pushed out (when it is ready, maybe in a couple more weeks), so you might as well test it now.

On Thu, Feb 15, 2018 at 3:40 PM, prasyell7 <prasad....@gmail.com> wrote:
Thanks for the reply. Yes I tried dateFormat and other options as per the API Documentation. However all options are ignored and when I remove "format: 'MMM,yy', " it displays just years, like 2010, 2020, 2050 etc.

Also I am afraid to update the version as this is a bug and this application is already in Production.

On Thursday, February 15, 2018 at 3:36:31 PM UTC-5, Daniel LaLiberte wrote:
I would recommend you try the 'upcoming' version.  There are many changes that might fix your problem.  In particular, you have an hAxis.format option that will probably be ignored in this context for the current version.
On Thu, Feb 15, 2018 at 3:30 PM, prasyell7 <prasad....@gmail.com> wrote:
I am using the following chart options.

      chartArea: { height: '80%', width: '90%' },
      hAxis: { slantedText: false, format: 'MMM,yy',
        gridlines: {
            count: -1,
            units: {
              months: {format: ['MMM,yy']}
            }
          },
          minorGridlines: {
          color: 'none',
          }
      },

H-Axis renders and displays correctly when there are multiple intervals, like months, years etc. But when there is only one unit (e.g one month), it displays times tamp on the h-axis. Both the pictures are attached.

I tried changing the format many ways, but still no luck, all the options are ignored by Google API.

Any idea?

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



--

--
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.

For more options, visit https://groups.google.com/d/optout.



--

prasyell7

unread,
Feb 15, 2018, 3:50:24 PM2/15/18
to Google Visualization API
Without updating and upgrading the version, can we not fix this with the existing version?


On Thursday, February 15, 2018 at 3:44:32 PM UTC-5, Daniel LaLiberte wrote:
The 'upcoming' version will be changed to 'current' once it is pushed out (when it is ready, maybe in a couple more weeks), so you might as well test it now.
On Thu, Feb 15, 2018 at 3:40 PM, prasyell7 <prasad....@gmail.com> wrote:
Thanks for the reply. Yes I tried dateFormat and other options as per the API Documentation. However all options are ignored and when I remove "format: 'MMM,yy', " it displays just years, like 2010, 2020, 2050 etc.

Also I am afraid to update the version as this is a bug and this application is already in Production.

On Thursday, February 15, 2018 at 3:36:31 PM UTC-5, Daniel LaLiberte wrote:
I would recommend you try the 'upcoming' version.  There are many changes that might fix your problem.  In particular, you have an hAxis.format option that will probably be ignored in this context for the current version.
On Thu, Feb 15, 2018 at 3:30 PM, prasyell7 <prasad....@gmail.com> wrote:
I am using the following chart options.

      chartArea: { height: '80%', width: '90%' },
      hAxis: { slantedText: false, format: 'MMM,yy',
        gridlines: {
            count: -1,
            units: {
              months: {format: ['MMM,yy']}
            }
          },
          minorGridlines: {
          color: 'none',
          }
      },

H-Axis renders and displays correctly when there are multiple intervals, like months, years etc. But when there is only one unit (e.g one month), it displays times tamp on the h-axis. Both the pictures are attached.

I tried changing the format many ways, but still no luck, all the options are ignored by Google API.

Any idea?

--
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.



--

--
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.
Visit this group at https://groups.google.com/group/google-visualization-api.



--

Daniel LaLiberte

unread,
Feb 15, 2018, 3:56:33 PM2/15/18
to Google Visualization API
The current version will not be changed until it is updated with the upcoming version.  There might be a workaround you could apply with the current version, but I don't really want to try to figure it out since it will be obsolete soon anyway.

To unsubscribe from this group and stop receiving emails from it, send an email to google-visualization-api+unsubscr...@googlegroups.com.



--

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

To post to this group, send email to google-visua...@googlegroups.com.
Visit this group at https://groups.google.com/group/google-visualization-api.



--

--
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.

For more options, visit https://groups.google.com/d/optout.



--
Reply all
Reply to author
Forward
0 new messages