Skip to content

Scatter / Bubble Chart ^0.1.18 ​

Plot discrete points in a 2D plane. Pass r on each point to turn it into a bubble — useful for showing a third dimension like population or revenue.

Basic scatter ​

34.640.9347.2753.659.9366.2634.739.9545.250.4655.7160.9666.22
vue
<VxScatterChart :data="[{ x: 12, y: 34 }, { x: 48, y: 21 }, ...]" />

Multiple series ​

35.4743.2250.9858.7466.574.2624.6233.8343.0452.2461.4570.6579.86
Group A
Group B
Group C
vue
<VxScatterChart :data="[
  { name: 'Group A', data: [...] },
  { name: 'Group B', data: [...] },
  { name: 'Group C', data: [...] },
]" />

Bubble chart ​

Third dimension via the r property on each point.

62.9567.5772.1976.8181.4386.05-2.2510.423.0535.748.356173.65GDP per capita (k$)Life expectancy
vue
<VxScatterChart
  :data="[{ name: 'Countries', data: [
    { x: 70.2, y: 79, r: 332, label: 'USA' },
    { x: 12.5, y: 78, r: 1420, label: 'China' },
    ...
  ]}]"
  xLabel="GDP per capita"
  yLabel="Life expectancy"
/>

With axis titles ​

54.0762.5471.0179.4787.9496.41153.27159.65166.04172.43178.81185.2191.58Height (cm)Weight (kg)
Male
Female
vue
<VxScatterChart :data="data" xLabel="Height (cm)" yLabel="Weight (kg)" />

Reference lines ​

Highlight target zones or thresholds on either axis.

2.924.155.386.627.859.0817.2545.6774.08102.5130.92159.33187.75CostScoreTarget scoreBudget
vue
<VxScatterChart
  :data="data"
  :references="[
    { axis: 'y', value: 6, label: 'Target score', color: '#22c55e' },
    { axis: 'x', value: 100, label: 'Budget',     color: '#ef4444' },
  ]"
/>

Solid dots (no stroke) ​

35.4743.2250.9858.7466.574.2624.6233.8343.0452.2461.4570.6579.86
Group A
Group B
Group C
vue
<VxScatterChart :data="data" :stroke="false" :fillOpacity="0.85" />

Starfield (bubbles) ​

-4.9217.043960.9682.92104.88-3.4814.4832.4550.4168.3786.33104.29
vue
<VxScatterChart
  :data="stars"
  :minBubbleRadius="1"
  :maxBubbleRadius="10"
  :fillOpacity="0.5"
/>

Custom colors ​

35.4743.2250.9858.7466.574.2624.6233.8343.0452.2461.4570.6579.86
Group A
Group B
Group C
vue
<VxScatterChart :data="data" :colors="['#ef4444', '#22c55e', '#6366f1']" />

Props ​

PropTypeDefaultDescription
dataScatterPoint[] | ScatterChartSeries[][]Points or series
heightnumber320SVG height
xLabel / yLabelstring''Axis titles
colorsstring[][]Palette override
dotRadiusnumber5Scatter dot radius
minBubbleRadiusnumber4Min bubble radius
maxBubbleRadiusnumber28Max bubble radius
fillOpacitynumber0.65Dot fill opacity
strokebooleantrueDraw outline on dots
gridbooleantrueShow grid
axisbooleantrueShow axis values
legendbooleantrueShow legend
tooltipbooleantrueShow hover tooltip
animatebooleantrueFade / scale in
xTicks / yTicksnumber6/5Axis tick count
xMin/xMax/yMin/yMaxnumberautoForce axis bounds
referencesScatterChartReference[][]Horizontal / vertical guides

Events ​

EventPayload
hover{ seriesIndex, pointIndex, point }
click{ seriesIndex, pointIndex, point }