make sure the date histogram interval is really large so you only get one data point back (pie chart panel only supports time series so you need the date histogram).
I set the interval to 1 month. And everything went fine.
So, now the interval is 1 month, and I choose to see the data over last 6 months. Now, again it shows me incorrect data. So, now I have to change interval to 6 months. And It shows me the correct data.
because date histogram splits count into buckets by your chosen interval, if you always want the total for the time range set interval to 6y or something big like that.
Or in pie chart options set the stat to show to Total