Axis labels on bar chart shows full date instead just hour when summarizing by hour of day

We have a chart that summarizes data by hour of day created through a custom question. The axis labels should just show 12AM, 1AM, 2AM, 3AM, 4AM, etc, but instead they show the full datetime, using the day before whatever day I happen to be viewing the chart on. For example, today it It reads May 20, 2020, 12: AM,May 20, 2020, 1:00 AM, etc.

This happens when I’m using the custom question editor to summarize a column by “datetime: Hour of day” - where datatime is the name of one of the columns on our table. It appears that “Hour of Day” is the only one that behaves like this. If I choose any other option to summarize by, such as Minute of hour, Day of week, … Quarter of Year, then the axis labels display as expected.

The attached screenshot shows two copies of the chart in question, one as it looked sometime last year, and one as looked a week ago. Aside from the numbers and the dates, the chart still looks like that now.

l

Hi @randy
Please post “Diagnostic Info” from Admin > Troubleshooting.
What is Field Type of your x-axis column in Admin > Data Model?

{
  "browser-info": {
    "language": "en",
    "platform": "MacIntel",
    "userAgent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/81.0.4044.138 Safari/537.36",
    "vendor": "Google Inc."
  },
  "system-info": {
    "file.encoding": "UTF-8",
    "java.runtime.name": "OpenJDK Runtime Environment",
    "java.runtime.version": "11.0.5+10",
    "java.vendor": "AdoptOpenJDK",
    "java.vendor.url": "https://adoptopenjdk.net/",
    "java.version": "11.0.5",
    "java.vm.name": "OpenJDK 64-Bit Server VM",
    "java.vm.version": "11.0.5+10",
    "os.name": "Linux",
    "os.version": "4.14.173-137.229.amzn2.x86_64",
    "user.language": "en",
    "user.timezone": "America/Toronto"
  },
  "metabase-info": {
    "databases": [
      "postgres"
    ],
    "hosting-env": "unknown",
    "application-database": "postgres",
    "application-database-details": {
      "database": {
        "name": "PostgreSQL",
        "version": "10.10"
      },
      "jdbc-driver": {
        "name": "PostgreSQL JDBC Driver",
        "version": "42.2.8"
      }
    },
    "run-mode": "prod",
    "version": {
      "date": "2020-04-21",
      "tag": "v0.35.3",
      "branch": "release-0.35.x",
      "hash": "1d424cb"
    },
    "settings": {
      "report-timezone": "US/Eastern"
    }
  }
}

Field type is “entity key” - it’s part of a composite primary key, the other part being a foreign key.

@randy
So you’re using a DateTime column as the Primary Key for your table?
There’s a handful of issues open about that, so that’s probably causing some problems.
If you set the Field Type to “Creation timestamp”, then it should display correctly.

Hi @flamber,

I updated my comment as you were writing yours, not sure if you saw my update. The column is one of two parts of a primary key.

The column doesn’t represent the creation of the records in question. Will that matter?

@randy It doesn’t matter which Field Type you use, as long as it’s one of the timestamps. The various creation/join/deleted are used for x-rays.

I changed it, so now it looks better in the individual question*, but in the dashboard that uses the question, it is still showing the full datetimes.

* but still not the same. In the old graph, it shows just the hour number, but now it includes the minutes as well, so I see 1:00 PM, 2:00 PM, 3:00 PM, etc. instead of 1 PM, 2 PM, 3 PM, etc.

Scratch this. It’s now showing correctly in the dashboard. I guess it just took time for the changes to propagate.