Bar chart with count () every day

Hello,

i want to have with Grafana and FLUX language a bar chart where I count the number of database entries of a specific datapoint and put it in a bar chart and show it from the last 2 or 4 weeks - it should be the whole da and not dependant of the time range which is defined.
I don’t know how to do that because with FLUX everything is totally different than with InfluxQL.

It should look like this: