Creating buckets on x-axis based on percentile in kibana

I have 2 fields, A & B in my document. I want to create buckets on the x-axis based on percentiles of A say p20, p40, p60, p80 and p100. On the y-axis I want to plot the average of field B within each of the buckets.

One of the aggregations available on the y axis while using kibana is percentile. I wanted to know if it was possible to create buckets on x-axis with percentile

This isn't currently possible with Elasticsearch, but there is an open issue for it: https://github.com/elastic/elasticsearch/issues/19546