Histogram with queries of dates sorted numerically by month

Hi, I need to insert in a histogram on Grafana the results of a query on a field called “dateAdd” in elasticsearch containing dates.
These dates should be sorted by month and the number of events per month should be counted. How can I achieve this?
Thanks in advance to those who can help me.