if (mChart.isDrawHoleEnabled() && mBitmapCanvas != null) {
@Override protected float[] getMarkerPosition(Highlight highlight) { MPPointF center = getCenterCircleBox(); float r = getRadius(); float off = r / 10f * 3.6f; if (isDrawHoleEnabled()) { off = (r - (r / 100f * getHoleRadius())) / 2f; } r -= off; // offset to keep things inside the chart float rotationAngle = getRotationAngle(); int entryIndex = (int) highlight.getX(); // offset needed to center the drawn text in the slice float offset = mDrawAngles[entryIndex] / 2; // calculate the text position float x = (float) (r * Math.cos(Math.toRadians((rotationAngle + mAbsoluteAngles[entryIndex] - offset) * mAnimator.getPhaseY())) + center.x); float y = (float) (r * Math.sin(Math.toRadians((rotationAngle + mAbsoluteAngles[entryIndex] - offset) * mAnimator.getPhaseY())) + center.y); MPPointF.recycleInstance(center); return new float[]{x, y}; }
float y = center.y + offset.y; float innerRadius = mChart.isDrawHoleEnabled() && !mChart.isDrawSlicesUnderHoleEnabled() ? mChart.getRadius() * (mChart.getHoleRadius() / 100f) : mChart.getRadius();
final MPPointF center = mChart.getCenterCircleBox(); final float radius = mChart.getRadius(); final boolean drawInnerArc = mChart.isDrawHoleEnabled() && !mChart.isDrawSlicesUnderHoleEnabled(); final float userInnerRadius = drawInnerArc ? radius * (mChart.getHoleRadius() / 100.f)
final boolean drawInnerArc = mChart.isDrawHoleEnabled() && !mChart.isDrawSlicesUnderHoleEnabled(); if (drawInnerArc && mChart.isDrawRoundedSlicesEnabled()) return;
float labelRadiusOffset = radius / 10f * 3.6f; if (mChart.isDrawHoleEnabled()) { labelRadiusOffset = (radius - (radius * holeRadiusPercent)) / 2f; if (mChart.isDrawHoleEnabled()) line1Radius = (radius - (radius * holeRadiusPercent))
if (chart.isDrawHoleEnabled()) chart.setDrawHoleEnabled(false); else boolean toSet = !chart.isDrawRoundedSlicesEnabled() || !chart.isDrawHoleEnabled(); chart.setDrawRoundedSlices(toSet); if (toSet && !chart.isDrawHoleEnabled()) { chart.setDrawHoleEnabled(true);
if (chart.isDrawHoleEnabled()) chart.setDrawHoleEnabled(false); else boolean toSet = !chart.isDrawRoundedSlicesEnabled() || !chart.isDrawHoleEnabled(); chart.setDrawRoundedSlices(toSet); if (toSet && !chart.isDrawHoleEnabled()) { chart.setDrawHoleEnabled(true);
@Override protected float[] getMarkerPosition(Highlight highlight) { MPPointF center = getCenterCircleBox(); float r = getRadius(); float off = r / 10f * 3.6f; if (isDrawHoleEnabled()) { off = (r - (r / 100f * getHoleRadius())) / 2f; } r -= off; // offset to keep things inside the chart float rotationAngle = getRotationAngle(); int entryIndex = (int) highlight.getX(); // offset needed to center the drawn text in the slice float offset = mDrawAngles[entryIndex] / 2; // calculate the text position float x = (float) (r * Math.cos(Math.toRadians((rotationAngle + mAbsoluteAngles[entryIndex] - offset) * mAnimator.getPhaseY())) + center.x); float y = (float) (r * Math.sin(Math.toRadians((rotationAngle + mAbsoluteAngles[entryIndex] - offset) * mAnimator.getPhaseY())) + center.y); MPPointF.recycleInstance(center); return new float[]{x, y}; }
@Override protected float[] getMarkerPosition(Highlight highlight) { MPPointF center = getCenterCircleBox(); float r = getRadius(); float off = r / 10f * 3.6f; if (isDrawHoleEnabled()) { off = (r - (r / 100f * getHoleRadius())) / 2f; } r -= off; // offset to keep things inside the chart float rotationAngle = getRotationAngle(); int entryIndex = (int) highlight.getX(); // offset needed to center the drawn text in the slice float offset = mDrawAngles[entryIndex] / 2; // calculate the text position float x = (float) (r * Math.cos(Math.toRadians((rotationAngle + mAbsoluteAngles[entryIndex] - offset) * mAnimator.getPhaseY())) + center.x); float y = (float) (r * Math.sin(Math.toRadians((rotationAngle + mAbsoluteAngles[entryIndex] - offset) * mAnimator.getPhaseY())) + center.y); MPPointF.recycleInstance(center); return new float[]{x, y}; }
@Override protected float[] getMarkerPosition(Highlight highlight) { MPPointF center = getCenterCircleBox(); float r = getRadius(); float off = r / 10f * 3.6f; if (isDrawHoleEnabled()) { off = (r - (r / 100f * getHoleRadius())) / 2f; } r -= off; // offset to keep things inside the chart float rotationAngle = getRotationAngle(); int entryIndex = (int) highlight.getX(); // offset needed to center the drawn text in the slice float offset = mDrawAngles[entryIndex] / 2; // calculate the text position float x = (float) (r * Math.cos(Math.toRadians((rotationAngle + mAbsoluteAngles[entryIndex] - offset) * mAnimator.getPhaseY())) + center.x); float y = (float) (r * Math.sin(Math.toRadians((rotationAngle + mAbsoluteAngles[entryIndex] - offset) * mAnimator.getPhaseY())) + center.y); MPPointF.recycleInstance(center); return new float[]{x, y}; }
@Override protected float[] getMarkerPosition(Highlight highlight) { MPPointF center = getCenterCircleBox(); float r = getRadius(); float off = r / 10f * 3.6f; if (isDrawHoleEnabled()) { off = (r - (r / 100f * getHoleRadius())) / 2f; } r -= off; // offset to keep things inside the chart float rotationAngle = getRotationAngle(); int entryIndex = (int) highlight.getX(); // offset needed to center the drawn text in the slice float offset = mDrawAngles[entryIndex] / 2; // calculate the text position float x = (float) (r * Math.cos(Math.toRadians((rotationAngle + mAbsoluteAngles[entryIndex] - offset) * mAnimator.getPhaseY())) + center.x); float y = (float) (r * Math.sin(Math.toRadians((rotationAngle + mAbsoluteAngles[entryIndex] - offset) * mAnimator.getPhaseY())) + center.y); MPPointF.recycleInstance(center); return new float[]{x, y}; }
if (mChart.isDrawHoleEnabled() && mBitmapCanvas != null) {
if (mChart.isDrawHoleEnabled() && mBitmapCanvas != null) {
if (mChart.isDrawHoleEnabled() && mBitmapCanvas != null) {
if (mChart.isDrawHoleEnabled() && mBitmapCanvas != null) {
float y = center.y + offset.y; float innerRadius = mChart.isDrawHoleEnabled() && !mChart.isDrawSlicesUnderHoleEnabled() ? mChart.getRadius() * (mChart.getHoleRadius() / 100f) : mChart.getRadius();
float y = center.y + offset.y; float innerRadius = mChart.isDrawHoleEnabled() && !mChart.isDrawSlicesUnderHoleEnabled() ? mChart.getRadius() * (mChart.getHoleRadius() / 100f) : mChart.getRadius();
float y = center.y + offset.y; float innerRadius = mChart.isDrawHoleEnabled() && !mChart.isDrawSlicesUnderHoleEnabled() ? mChart.getRadius() * (mChart.getHoleRadius() / 100f) : mChart.getRadius();
if (mChart.isDrawHoleEnabled()) mChart.setDrawHoleEnabled(false); else