Display piechart

Hi, I'm trying to display pie chart,
but little guide for me, so I'm asking your help.

I built up elasticsearch index as follows
{id:1,group:fruit,item:apple,sold:Y,yymm:202105}
{id:2,group:fruit,item:banana,sold:Y,yymm:202105}
{id:3,group:fruit,item:grape,sold:N,yymm:202105}
{id:4,group:fruit,item:orange,sold:N,yymm:202105}

I want this data for '202105'

image

display pie chart : 4 areas
apple & grape => color:blue
banana&orange => color:grey

I'm tried to find for this solution, but I can't. Please help me!

Thanks in advance.

You probably want something like this;
Screen Shot 2021-05-20 at 13.09.36

And then add another single filter for the other two fruits to group them

Thanks for your help.

I think result is ok.
but fruit's name are displayed (4 kinds) in pie charts.

if the data adds as below

{id:11,group:fruit,item:apple,sold:Y,yymm:202106}
{id:12,group:fruit,item:banana,sold:N,yymm:202106}
{id:13,group:fruit,item:grape,sold:Y,yymm:202106}
{id:14,group:vegetable,item:cucumber,sold:N,yymm:202106}
{id:15,group:vegetable,item:carrot,sold:N,yymm:202106}

the pie charts displays same result for yymm:'202105' and group:fruit for 4 section

if the condition are changed yymm:202106 and grou:vegetable => display 2 section and they filled color by 'gray' (sold:N)

I mean sold items are filled by blue, and not sold items are filled by gray.
And all items are displayed or regended for specific condition.