Issue to show count in Pie chart

Hi Everyone,

I would like to show the counts of my elasticsearch documents by dispatch_status in Pie chart but I am getting following error: this.datapoints is undefined
For info below is the response got in the Query Inspector where we can see that I have 241 docs success and 2 failed.

response:Object
responses:Array[1]
0:Object
took:0
timed_out:false
_shards:Object
hits:Object
aggregations:Object
2:Object
doc_count_error_upper_bound:0
sum_other_doc_count:0
buckets:Array[2]
0:Object
key:“success”
doc_count:241
1:Object
key:“failed”
doc_count:2
status:200

Any support will be high appreciated.

Thanks,
Hamid

Please paste here the query in Grafana… Still not clear about the query