HoloGraphLibrary icon indicating copy to clipboard operation
HoloGraphLibrary copied to clipboard

PieGraph not appearing like in example screenshot

Open ankushg opened this issue 12 years ago • 4 comments

In the example screenshot for the PieGraph, the slices are shown as being equally thick throughout. When I use the PieGraph as shown in the example, I get a chart that has slices with the proper arc lengths, but with the shaded portion simply being a straight line connecting the endpoints of the arc.

Weird PieGraph vs. Expected PieGraph

Additionally, is it possible to have the slices actually be slices (i.e., go all the way into the middle) instead of thick line segments? How would that be accomplished?

ankushg avatar Jul 31 '13 02:07 ankushg

That's weird, I need to investigate that. Do you have the same issue when building the example app?

Androguide avatar Aug 02 '13 18:08 Androguide

I have the same issue, but it's weird it doesn't happen on some devices. I've tested on a nexus 4 and nexus 10 tablet working fine and looking good, but in a galaxy tab II and on a xperia tipo looks like the image ankushg posted. I've been looking into source code but I can't find where is the bug.

emanzanoengisoft avatar Sep 03 '13 14:09 emanzanoengisoft

You need to call setThickness on the PieGraph, with a smaller value. The default value is 50, which is too thick for the height/width of your graph.

mbialas avatar Oct 07 '13 20:10 mbialas

A solution for the project could be that in the onDraw or onLayout method of PieGraph, retrieve the height/width and lower the thickness if it is past the threshold (half of the height/width??)

mbialas avatar Oct 08 '13 14:10 mbialas