View Live Example
Overview
Bubble charts are powerful scatter plots where the size of each point (bubble) represents a third dimension of data. They excel at visualizing relationships between three continuous variables simultaneously, making them perfect for market analysis, performance dashboards, and multi-dimensional data exploration.Basic Bubble Chart
Create a simple bubble chart with three data dimensions:Color Mapping
Add categorical grouping with color encoding:Bubble Sizing
Size Range Control
Control the minimum and maximum bubble sizes for typical data:Size Guide in Legend
New in v1.10.0: Add a visual size guide to your legend showing min, mid, and max bubble sizes!
title parameter to geomBubble() to automatically display a bubble size guide in the legend:
- Visual Reference: Shows three bubbles (min, mid, max) with actual data values
- Automatic Scaling: Values and sizes match your data and scale configuration
- Layout Aware: Adapts to horizontal or vertical legend positioning
- Integrated: Works seamlessly with existing legend items and color keys
Advanced Bubble Sizing
For precise control over the scale domain and visual presentation, use bothlimits and minSize/maxSize:
minSize/maxSizecontrol how bubbles appear visually (10-40 pixel radius)limitsset the scale’s reference range: deals at 1M get 40px radius- All deals still render - deals outside limits are scaled proportionally (e.g., $2M deal gets 80px radius)
- Deals within the limits range will be scaled linearly to the visual size range
- Without
limits: Scale domain uses actual data range, sominSize/maxSizemap to actual min/max data values - With
limits: Scale domain is set to limits; values outside limits still render, scaled proportionally beyond minSize/maxSize - This preserves data accuracy - all values render, with outliers appearing larger/smaller than the reference range
- Use
limitsto set a consistent scale domain across multiple charts, not to filter data
Dynamic Size Scaling
Use a slider or control to adjust bubble sizes dynamically:Bubble Styling
Shape Options
Customize bubble shapes:PointShape.circle(default)PointShape.squarePointShape.triangle
Advanced Styling
Labels and Text
Bubble Labels
Add labels to bubbles:Custom Label Positioning
Scale Customization
Axis Formatting
Format axis labels for better readability:Size Scale Optimization
Ensure meaningful size differences:Interactive Features
Rich Tooltips
Create informative hover tooltips:Click Interactions
Handle bubble selection:Animation
Entrance Animation
Animate bubbles appearing:Smooth Animation
Customize animation timing and curves:Dual Y-Axis Support
Use bubble charts with secondary Y-axis:Market Analysis Example
Complete Dashboard
A comprehensive market analysis bubble chart:Best Practices
Size Encoding
Size Encoding
- Use bubble size for positive, quantitative variables
- Keep size ratios between 2:1 and 5:1 for optimal perception
- Ensure smallest bubbles are clearly visible (minimum 5-8px radius)
- Consider area vs radius scaling based on your data distribution
Color and Transparency
Color and Transparency
- Use alpha (transparency) for overlapping bubbles
- Limit color categories to 6-8 for clarity
- Add white borders to improve bubble separation
- Consider colorblind-friendly palettes
Data Density
Data Density
- For dense data, increase transparency and reduce size
- Use tooltips instead of labels for cluttered charts
- Consider data aggregation or filtering for very large datasets
- Provide zoom/pan functionality for detailed exploration
Interactive Design
Interactive Design
- Always include informative tooltips
- Use consistent hover states
- Consider click-through navigation to detail views
- Provide size controls for user customization
Performance
Performance
- For 500+ bubbles, reduce border width or disable borders
- Use lower alpha values for better performance
- Consider data virtualization for very large datasets
- Test on different device sizes and performance levels