@Override
    public boolean checkTouch(float touchX, float touchY) {
        selectedValue.clear();
        final BubbleChartData data = dataProvider.getBubbleChartData();
        int valueIndex = 0;
        for (BubbleValue bubbleValue : data.getValues()) {
            float rawRadius = processBubble(bubbleValue, bubbleCenter);

            if (ValueShape.SQUARE.equals(bubbleValue.getShape())) {
                if (bubbleRect.contains(touchX, touchY)) {
                    selectedValue.set(valueIndex, valueIndex, SelectedValueType.NONE);
                }
            } else if (ValueShape.CIRCLE.equals(bubbleValue.getShape())) {
                final float diffX = touchX - bubbleCenter.x;
                final float diffY = touchY - bubbleCenter.y;
                final float touchDistance = (float) Math.sqrt((diffX * diffX) + (diffY * diffY));

                if (touchDistance <= rawRadius) {
                    selectedValue.set(valueIndex, valueIndex, SelectedValueType.NONE);
                }
            } else {
                throw new IllegalArgumentException("Invalid bubble shape: " + bubbleValue.getShape());
            }

            ++valueIndex;
        }

        return isTouched();
    }
Rect used for drawing bubbles with SHAPE_SQUARE.
hellocharts-library/src/lecho/lib/hellocharts/renderer/BubbleChartRenderer.java