metabase / metabase/metabase

Timeseries Chart Scale skips to the next month showing confusing results

Open
#49,662 4 comments 0 reactions 0 assignees View on GitHub
.Frontend .Product Input Needed .Team/UXWest Difficulty:Hard Priority:P2 Type:Bug Visualization/Charts
Dominant language
Clojure
Stars
49.3k
Forks
6.8k
Avg merge
1d 13h
Merged PRs (30d)
653

Description

### Describe the bug

Easier to see than to explain. This is the data as a Table:

![Image](https://github.com/user-attachments/assets/eddc5475-d406-485a-a1a0-5b441ad70990)

This is the Data as a bar chart with Ordinal Scale:

![Image](https://github.com/user-attachments/assets/f1913fbf-8c5a-4959-b24e-7740d100e4ce)

This is the Data as a bar chart with Timeseries Scale:

![Image](https://github.com/user-attachments/assets/a2f61595-dd94-4860-8ba7-fbe91b9f55d6)

### To Reproduce

I am using Postgres but you can checkout this [question on stats](https://stats.metabase.com/question/20453-timeseries-confusing-chart)

1. Go to New -> SQL Question -> Run the below:

```
Select TO_DATE('30/06/2015', 'DD/MM/YYYY') AS date, 5555 AS value
UNION
Select TO_DATE('30/09/2015', 'DD/MM/YYYY') AS date, 6555 AS value
```

2. Visualise as a Bar chart and set the Scale to a Timeseries, notice the actual Data doesn't match with the chart:

![Image](https://github.com/user-attachments/assets/e3bd3aef-9e9f-410b-b8e0-b478a6da1cfa)

![Image](https://github.com/user-attachments/assets/d673ef4f-ec40-4c88-8fb0-30f0591ed9ff)

### Expected behavior

The Timeseries scale matches what you get in the chart. So my expectation would be to get a June Bar and a July, August empty bars then a September Bar. Something like the below when you change the Date from 30th to 14th

![Image](https://github.com/user-attachments/assets/668396cc-798c-4a46-8f0a-b69c37664ecd)

### Logs

None that are relevant

### Information about your Metabase installation

Happens both on 50 and 51

### Severity

Might look like a cosmetic bug but when you hit this you don't understand what is going on

### Additional context

_No response_

Contributor guide

Open the contributing guide

Research direction

Start by running the provided PostgreSQL query in Metabase and comparing the ordinal and timeseries bar charts. Investigate the timeseries scale behavior for dates such as June 30 and September 30; done means the chart represents the source dates correctly, including empty intervals between them.

Written by the indexing model from the issue text.

Assessment

Tech stack
postgresql
Domain
data-visualization
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.