@Override public Highlight getHighlight(float x, float y) { float touchDistanceToCenter = mChart.distanceToCenter(x, y); // check if a slice was touched if (touchDistanceToCenter > mChart.getRadius()) { // if no slice was touched, highlight nothing return null; } else { float angle = mChart.getAngleForPoint(x, y); if (mChart instanceof PieChart) { angle /= mChart.getAnimator().getPhaseY(); } int index = mChart.getIndexForAngle(angle); // check if the index could be found if (index < 0 || index >= mChart.getData().getMaxEntryCountSet().getEntryCount()) { return null; } else { return getClosestHighlight(index, x, y); } } }
@Override public Highlight getHighlight(float x, float y) { float touchDistanceToCenter = mChart.distanceToCenter(x, y); // check if a slice was touched if (touchDistanceToCenter > mChart.getRadius()) { // if no slice was touched, highlight nothing return null; } else { float angle = mChart.getAngleForPoint(x, y); if (mChart instanceof PieChart) { angle /= mChart.getAnimator().getPhaseY(); } int index = mChart.getIndexForAngle(angle); // check if the index could be found if (index < 0 || index >= mChart.getData().getMaxEntryCountSet().getEntryCount()) { return null; } else { return getClosestHighlight(index, x, y); } } }
@Override public Highlight getHighlight(float x, float y) { float touchDistanceToCenter = mChart.distanceToCenter(x, y); // check if a slice was touched if (touchDistanceToCenter > mChart.getRadius()) { // if no slice was touched, highlight nothing return null; } else { float angle = mChart.getAngleForPoint(x, y); if (mChart instanceof PieChart) { angle /= mChart.getAnimator().getPhaseY(); } int index = mChart.getIndexForAngle(angle); // check if the index could be found if (index < 0 || index >= mChart.getData().getMaxEntryCountSet().getEntryCount()) { return null; } else { return getClosestHighlight(index, x, y); } } }
@Override public Highlight getHighlight(float x, float y) { float touchDistanceToCenter = mChart.distanceToCenter(x, y); // check if a slice was touched if (touchDistanceToCenter > mChart.getRadius()) { // if no slice was touched, highlight nothing return null; } else { float angle = mChart.getAngleForPoint(x, y); if (mChart instanceof PieChart) { angle /= mChart.getAnimator().getPhaseY(); } int index = mChart.getIndexForAngle(angle); // check if the index could be found if (index < 0 || index >= mChart.getData().getMaxEntryCountSet().getEntryCount()) { return null; } else { return getClosestHighlight(index, x, y); } } }
@Override public Highlight getHighlight(float x, float y) { float touchDistanceToCenter = mChart.distanceToCenter(x, y); // check if a slice was touched if (touchDistanceToCenter > mChart.getRadius()) { // if no slice was touched, highlight nothing return null; } else { float angle = mChart.getAngleForPoint(x, y); if (mChart instanceof PieChart) { angle /= mChart.getAnimator().getPhaseY(); } int index = mChart.getIndexForAngle(angle); // check if the index could be found if (index < 0 || index >= mChart.getData().getMaxEntryCountSet().getEntryCount()) { return null; } else { return getClosestHighlight(index, x, y); } } }