When I open the long term data page and select one of the three options, the graphs are blank.
Fair enough at this point.
I am prompted to select the date and time range the Last 7 days is already selected for me.
So that leads to the question:
If that is the default (?) why aren't the graphs populated to that when you open that page by default?
Internally, pihole uses daterangepicker for the data and time selector. Default selection is set to "last 7 days" in pihole. If you ommit this pre-selection, datarangepicker will choose "today" internally.
(Even if this issue is 3 years old, the behavior is still the same, I just tried it)
Because it takes time to compute the statistics. More the less power your device had. Imagine a fairly active network with a dozen clients and Pi-hole being hosted on a Raspberry Pi Zero. Computing even the last 7 days might be something which needs several seconds. And it is something the database computes internally, so it is also not easily interruptible.
We do not trigger a processing when the page is opened to avoid an additional delay until the user can request what they want.
The long-term statistics are meant as a research tool, not something you use several times every day. It is more a scalpel rather than a kitchen knife. IMO it should allow the user to get what they want without being in their way. Hence, we designed it the way it is.
The post was more a question about what was being shown with defaults that weren't displayed on the graph.
Doing what you said removed the default part.
Personal opinion: Until there is a way to really have no selection, leave it with the 7 days pre-selection, even when it can confuse users initially. 7 days is a good range - not to less data to analyze and not to much for low RAM devices.
There is none. If you really point the prefilled intervals to null, the following happens:
The best we can do is to remove any suggestion of an initial range:
You see this makes the selection default to the current day 00:00 - 23:00 (even when it is only 11:19 my local time at this point). This is in agreement with the example referenced in the issue ticket mentioned by @yubiuser above:
Unfortunately, there is a bug in daterangepicker: When you simply click on [Apply], nothing happens when you don't specify a default interval. Even though you'd expect all queries of today given what the screenshot above shows you. I traced this down into a bug in the datetimerpcker engine. It is unexpectedly complex and difficult to fix because if drags its issue through almost a dozen different callbacks. We can, nevertheless, achieve the same thing by setting the default range.
So we have three options on the table:
Do nothing (keeps the preselected "Last 7 Days")
Change the default interval to something else (like the default start - end of today as suggested above)
Store what the user picked last time.
Mind that 3 has a drawback: datetimepicker works with absolute time. When we store your selection of "today" now and you visit the page tomorrow, your preselected range would be "yesterday". Converting things into relative time could be tricky (but I'm not ruling this out if people really want this !).
Yeah, I think I have to agree here. Having flicked between the devel and tweak/db_pages_default branches for the last 10 mins or so, I think it makes more sense to keep the existing behaviour.