Fixed drawing of hole colors
This commit is contained in:
parent
4b1112d2ef
commit
d9c0fd76e5
2 changed files with 5 additions and 5 deletions
|
@ -72,7 +72,7 @@ public class PieChartActivity extends DemoBase implements OnSeekBarChangeListene
|
|||
mChart.setCenterText(generateCenterSpannableText());
|
||||
|
||||
mChart.setDrawHoleEnabled(true);
|
||||
mChart.setHoleColor(Color.TRANSPARENT);
|
||||
mChart.setHoleColor(Color.WHITE);
|
||||
|
||||
mChart.setTransparentCircleColor(Color.WHITE);
|
||||
mChart.setTransparentCircleAlpha(110);
|
||||
|
|
|
@ -438,17 +438,17 @@ public class PieChartRenderer extends DataRenderer {
|
|||
float radius = mChart.getRadius();
|
||||
float holeRadius = radius * (mChart.getHoleRadius() / 100);
|
||||
PointF center = mChart.getCenterCircleBox();
|
||||
boolean hasHoleColor = mHolePaint.getColor() != 0;
|
||||
|
||||
if (hasHoleColor) {
|
||||
if (Color.alpha(mHolePaint.getColor()) > 0) {
|
||||
// draw the hole-circle
|
||||
mBitmapCanvas.drawCircle(
|
||||
center.x, center.y,
|
||||
holeRadius, mHolePaint);
|
||||
}
|
||||
|
||||
// only draw the circle if it can be seen (not covered by the hole), circle is independent of hole
|
||||
if (mChart.getTransparentCircleRadius() > mChart.getHoleRadius()) {
|
||||
// only draw the circle if it can be seen (not covered by the hole)
|
||||
if (Color.alpha(mTransparentCirclePaint.getColor()) > 0 &&
|
||||
mChart.getTransparentCircleRadius() > mChart.getHoleRadius()) {
|
||||
|
||||
int alpha = mTransparentCirclePaint.getAlpha();
|
||||
float secondHoleRadius = radius * (mChart.getTransparentCircleRadius() / 100);
|
||||
|
|
Loading…
Add table
Reference in a new issue