PhilJay / MPAndroidChart

A powerful 🚀 Android chart view / graph view library, supporting line- bar- pie- radar- bubble- and candlestick charts as well as scaling, panning and animations.
Other
37.64k stars 9.02k forks source link

Wrong percentage calculation in PieChart #3739

Open TheChetanShewale opened 6 years ago

TheChetanShewale commented 6 years ago

I am showing the data which I am getting from an API, there are 5 categories with values as given below: { "name": "Education", "investment": 35000 }, { "name": "Engineering", "investment": 185000 }, { "name": "Manufacturing", "investment": 500 }, { "name": "Others", "investment": 1188000 }, { "name": "Real Estate", "investment": 476045 } (See the screenshot attached below) The problem is that, the Manufacturing category has value 500 ( which is very small compared to other category values, even though the value is small but it's present ), In this scenario the percentage shown on PirChart is incorrect, Please help me to solve this problem upload

nsfantom commented 6 years ago

0.026531603% try data.setValueFormatter(new PercentFormatter(new DecimalFormat("###,###,##0.000")));