getredash / redash

Make Your Company Data Driven. Connect to any data source, easily visualize, dashboard and share your data.
http://redash.io/
BSD 2-Clause "Simplified" License
25.87k stars 4.32k forks source link

"Treat missing/null values as 0" Does not work for line charts with datetime scale x-axis #4717

Open orenpai opened 4 years ago

orenpai commented 4 years ago

Issue Summary

When creating a line chart with a datetime based x-axis, from a table with missing dates ("holes"), the line chart continues as if no data was present, even though the option "Treat missing/null values as 0" is turned on. In contrast, bar charts work as expected - in which the bar is nonexistent (effectively size 0) on those missing dates.

Steps to Reproduce

You can use this csv data as an example, or use the attached CSV. Incoming_Users_2020_03_09.csv.txt

dt,installs 06/02/2020,1 10/02/2020,8 11/02/2020,5 12/02/2020,1

(Please note European date format, switch month and day if necessary)

Create a chart visualization (x-axis is dt, y axis is installs); Make sure the "Treat missing/null values as 0" checkbox is selected. In the x-axis settings make sure the scale is Datetime (default). Notice how the chart line continues straight in all dates between 06/02 and 10/02, as if they value continued to be "1" for these dates (even though indeed no marker is present when you hover the chart with the mouse cursor). Switch to bar chart - all bars in the same dates show a value of 0 (no bar). Notice how unchecking and checking the checkbox "Treat missing/null values as 0" does not alter either of these charts.

Screenshots attached

BarChart LineChart

The expected behavior is that when the checkbox is checked, the line chart would go to 0 on the dates that are not available in the table, similar to how the bar chart looks. For the bar chart, if the checkbox is unchecked, I would expect the same bar value to be kept, similar to how the line chart is.

brad-natelborg commented 3 years ago

Agreed - was just looking into this same problem.