Skip to main content

Scatter & Bubble chart Pro

Two measures per row as points: does one rise with the other? groupKey colors and shapes points by group (with a legend that toggles them), sizeKey turns points into bubbles sized by area, and showTrend draws the least-squares line. Screen readers hear the ranges and how strongly the measures move together.

import { ScatterChart } from '@patine-ui/pro';

Live data​

Loading…
<View style={{ width: 380, gap: 8 }}>
  <Button size="sm" variant="outline" onPress={() => setData(roll())} style={{ alignSelf: 'flex-end' }}>Shuffle</Button>
  <ScatterChart
    data={data}
    xKey="spend"
    yKey="sales"
    sizeKey="deals"
    groupKey="region"
    xLabel="Ad spend ($K)"
    yLabel="Sales ($K)"
    sizeLabel="Deals"
    showTrend
    accessibilityLabel="Sales against ad spend, by region"
  />
</View>

Try the props​

Props
groupKey
sizeKey
grid
design
<ScatterChart
data={regions}
xKey="spend"
yKey="sales"
xLabel="Ad spend"
yLabel="Sales"
/>

Example: flat prices by size​

A housing site's sold listings: each dot is a flat, size against price, colored by neighbourhood and sized by rooms. The trend line shows what a square metre costs, and the dots far above it are the outliers.

Loading…
<View style={{ width: '100%' }}>
  <ScatterChart
    data={data}
    xKey="size"
    yKey="price"
    sizeKey="rooms"
    groupKey="area"
    xLabel="Size (m²)"
    yLabel="Price (€K)"
    sizeLabel="Rooms"
    showTrend
    height={280}
    accessibilityLabel="Sold flats in Amsterdam: size against price, by neighbourhood"
  />
</View>

Over time​

Loading…
<ScatterChart
  data={data}
  xKey="at"
  yKey="ms"
  yLabel="Response time"
  valueFormatter={(v) => `${v} ms`}
  referenceLines={[{ value: 200, label: 'Budget' }]}
  style={{ width: 380 }}
/>

Props​

The shared chart props, and:

PropTypeDefaultDescription
xKey / yKeystring—Numbers (or Dates on x).
sizeKeystring—Sizes each point by area: a bubble chart.
groupKeystring—Groups points into series with their own color, shape and legend toggle.
series{ key, label?, color? }[]—Labels and colors for groups.
xLabel / yLabel / sizeLabelstringthe keysNames in the tooltip and summary.
showTrendbooleanfalseThe line of best fit.
grid'value' | 'category' | 'both' | 'none''both'
minValue / maxValuenumberfrom the dataThe y axis's ends.
referenceLines{ value, label?, color?, dashed? }[]—
maxRadiusnumber18The biggest bubble.
xFormatter(x) => string—
defaultHiddenstring[]—Groups turned off at first.