Hi,
I am trying to create a bar chart where I have both the average documents count per day of the week (eg Monday to Sunday) over the entire period and the documents count over the current week.
So far I have only managed to query the total documents count per day of the week (see query below) but I don't know how to create the visualization.
POST /myindex/_search?size=0
{
"query":{
"match_all": {}
},
"aggs": {
"dayOfWeek": {
"terms": {
"script": {
"lang": "painless",
"source": "doc['date'].value.dayOfWeek"
}
}
}
}
}
The result I would like to obtain is as follows:

Thanks for you help

