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.56k stars 9.01k forks source link

Dynamicly Set specific color for specific slice of a PieChart #2331

Open chetan1011 opened 7 years ago

chetan1011 commented 7 years ago

I am trying to find a way to set a specific color to a slice of a PieChart based on some specific condition.

like if(category==fruit){ slice_color=red }else if(category==veggie){ slice_color=green }

Is there a different way to define a particular color to a particular slice of a PieChart

evasyuk commented 7 years ago

https://github.com/PhilJay/MPAndroidChart/issues/1830 this issue has code sample to change color of pies

khawars commented 6 years ago

@evasyuk how #1830 specifies dynamically assigning colors to slices?

suvDev commented 4 years ago

Still this issue exist, not able to assign color per slice and the library is picking up random entries from list instead of following 0...10 index approach.