@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); } } }
: legendWidth - 15.f; float bottomY = legendHeight + 15.f; float distLegend = distanceToCenter(bottomX, bottomY); float distReference = distanceToCenter(reference.x, reference.y); float minOffset = Utils.convertDpToPixel(5f);
@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); } } }
: legendWidth - 15.f; float bottomY = legendHeight + 15.f; float distLegend = distanceToCenter(bottomX, bottomY); float distReference = distanceToCenter(reference.x, reference.y); float minOffset = Utils.convertDpToPixel(5f);
: legendWidth - 15.f; float bottomY = legendHeight + 15.f; float distLegend = distanceToCenter(bottomX, bottomY); float distReference = distanceToCenter(reference.x, reference.y); float minOffset = Utils.convertDpToPixel(5f);
: legendWidth - 15.f; float bottomY = legendHeight + 15.f; float distLegend = distanceToCenter(bottomX, bottomY); float distReference = distanceToCenter(reference.x, reference.y); float minOffset = Utils.convertDpToPixel(5f);
: legendWidth - 15.f; float bottomY = legendHeight + 15.f; float distLegend = distanceToCenter(bottomX, bottomY); float distReference = distanceToCenter(reference.x, reference.y); float minOffset = Utils.convertDpToPixel(5f);