Thanks for your reply.
1.We want the $__timeGroup( ) supports QUARTER.
2.We hope the $__timeGroup( ) group the time by a whole natural week,month,quarter,year.
If so, the time of X axis will display the end of the natrual week,month,quarter,year.
The last data point will display the current date.
We write complex SQL to implement this kind of requirement, include grouping by time and filling missing value.
Below is the panel we created which group the time by Quarter:
Now we want to simplify the SQL.I am not sure if any other needs this kind of requirement, and maybe we will have more and more customization demand，so I wonder if there is any way for us to create macros or library for Grafana by ourselves.