InfluxDB dynamic downsampling in Main UI based on selected period

I cannot say anything about the integration of any function in the MainUI. But this is how I solved the problem.