MPAndroidChart icon indicating copy to clipboard operation
MPAndroidChart copied to clipboard

Draw image in pie chart center

Open ghost opened this issue 12 years ago • 5 comments

Hi, i have used this library and this works great. now i want image in center of pie chart instead of text, is it possible? can anyone help me?

ghost avatar Nov 17 '14 04:11 ghost

Image in center?I'm not sure but what i want is how to display values all with zero~,I can't see the RadarChart ,Do U know about it?

xf222zt avatar Nov 18 '14 05:11 xf222zt

Displaying images in the center of the chart is not supported. You will have to do that yourself.

Regards, Phil

PhilJay avatar Nov 18 '14 10:11 PhilJay

Great Lib! Maybe someday you can implemented ;) Gr8!

inakuhn avatar Nov 23 '16 23:11 inakuhn

Did anyone ever have any luck in implementing this?

NickDelfino avatar Apr 16 '17 14:04 NickDelfino

@NickDelfino I just wrote a little hack to acchive this:

I put my Piechart in a PercentFrameLayout and added a View on top of it. As I set a hole radius of 75% for chart (chart.setHoleRadius(75f);), I gave the view on top of the chart a width and height of 65% (I know that's not clean and you should calculate the correct percentage, but for me this is enough) and centered it. Then you can do whatever you want with this view...

It's just a simple hack but doesn't take much time and for my requirements it's enough

KatharinaSick avatar Apr 20 '17 08:04 KatharinaSick