You can use Terms aggregation | Elasticsearch Guide [8.8] | Elastic to create the first lot of buckets.
From there you have two options;
- calcuate the percentage outside Elasticsearch
- use something like this Using doc_count to calculate percentage after aggregation - #2 by spinscale
Elasticsearch doesn't provide this sort of output itself.