I'm plotting a time series chart with missing values. The generated query looks like this:
SELECT DATE_TRUNC('day', arrival_time) AS __timestamp,
COUNT(*) AS count
FROM public.data
GROUP BY DATE_TRUNC('day', arrival_time);
When plotting a time series line chart, values are correctly positioned on the x axis according to their date value:
On the other hand, when I plot a bar chart, values are positioned by their index in the data, not by their date:
I can solve this by using the resample function (pick 1D
/asfreq
), but I'm still wondering if there is a reason this works out of the box for the line chart but not for the bar chart.