Skip to main content
WireKit
Copy for LLM

Scatter + Bubble

Scatter charts plot pairs of numeric values to expose correlation. Bubble charts add a third axis (radius) — used for "X vs Y vs Magnitude" visualizations like LTV vs CAC vs customer count, or query duration vs row count vs index hit rate.

When to use

When you want to spot correlation or clusters in two-axis data. For ordered time-series prefer line charts; for categorical totals prefer bar charts.

Basic Example — LTV vs CAC by cohort

Customer LTV vs CAC across cohorts (€)

Bubble — query duration vs rows vs index hit rate

Query plan analysis: duration (ms) × row count × index hit %

The third dimension r is the bubble radius — typical convention: larger bubble = more important / more common / higher metric. WCAG 1.1.1 (Non-text content): every bubble chart should ship with a <table class="sr-only"> companion describing each data point.

Real-world recipe — Convert Eloquent rows into bubble data

@php
    $points = \App\Models\Query::recentSamples(50)
        ->map(fn ($q) => [
            'x' => $q->duration_ms,
            'y' => $q->rows_examined,
            'r' => max(2, min(30, (int) ($q->index_hit_pct / 4))),
        ])
        ->all();
@endphp

<x-wirekit-chart
    type="bubble"
    :datasets="[['label' => 'Query plan samples', 'data' => $points]]"
    height="320px"
/>

The max(2, min(30, ...)) clamp keeps bubbles in a visually-readable range; very small bubbles disappear under the line stroke, very large bubbles overlap each other unreadably.

See Also

Design Tokens

See Chart.js adapter — Design Tokens for the color, typography, and grid tokens shared across every Chart.js demo.