Bug description

When creating a bar chart with categorical x-axis, NULL values are omitted from the resulting chart.

Data: Apache Superset Bar chart (echart) does not show NULL values in categorical x-axis

Bar chart fails to show NULL value: Apache Superset Bar chart (echart) does not show NULL values in categorical x-axis

Pie chart shows the correct data: Apache Superset Bar chart (echart) does not show NULL values in categorical x-axis

Expected behavior NULL should be a series in the chart, as on the pie chart. In many cases it's valuable to know there are NULL values in the data. Users can always filter them out if desired.

If you wish to create the data table used here, you can run this Postgres statement:

CREATE TABLE browser_stats (browser VARCHAR(50), page VARCHAR(50));
INSERT INTO browser_stats (browser, page) 
VALUES 
    ('Firefox', 'home'),
    ('Chrome', 'home'),
    ('Chrome', 'home'),
    ('Safari', 'about'),
    (NULL, 'about');

Screenshots/recordings

No response

Superset version

4.0.2

Python version

I don't know

Node version

I don't know

Browser

Firefox

Additional context

I could find no relevant issues on GitHub or reports about this on Slack, which surprised me.

Checklist

  • [X] I have searched Superset docs and Slack and didn't find a solution to my problem.
  • [X] I have searched the GitHub issue tracker and didn't find a similar bug report.
  • [ ] I have checked Superset's logs for errors and if I found a relevant Python stacktrace, I included it here as text in the "additional context" section.

Comment From: rusackas

I wonder, does turning on the "zero imputation" fill method work here?

Comment From: sfirke

I wonder, does turning on the "zero imputation" fill method work here?

The "advanced analytics" section is not shown if the x-axis is categorical so not an option, unfortunately.

Comment From: rusackas

I'm assuming nothing has changed here, and this is still a legit issue?

Comment From: sfirke

I just confirmed this is still present on master branch as of the start of this week (so post-5.0.0)