Jira dashboard - JQL query


Recently I start working on creating dashboards on Jira to show the trend of the bugs/issues logged in with our environment. I can see in-built gadgets available and we can just add to our dashboard and make changes in passing the necessary inputs. Even in creating filters part with JQL query I do not see much options like user defined functions/fields to create a search filter.

Most of the gadgets are useful in showing only the count of issues based on some fields like project, type, version, assignee, etc., So I just wanted to know is there any other options to do some aggregation/statistical part with the JQL/gadgets to show the data in the way which we are expecting.

Could anyone please help me on this.