Docs
📊 ⏐ Charts
Bubble Chart

Bubble Chart

A Bubble Chart visualizes data using circles ('bubbles'), where the size represents a numerical value, allowing comparison of multiple data points across two axes. It shows three dimensions of data using x and y coordinates for positioning and bubble size for value.

Where to use:

  • Show Relationships: Ideal for showing relationships and comparisons between items.
  • Display Multiple Data Points: Useful in scientific and statistical data.
  • Visualize Patterns: Great for revealing patterns and correlations in data.

Quick Start

To create a bubble chart, use import the BubbleChart and give it data. The chart will automatically configure itself with the default options exposed via props.

Examples

API

BubbleChart (opens in a new tab)

PropDescriptionDefault
dataData the chart will receive to render.
ChartShallowDataShape<ChartDataTypes | [ChartDataTypes, ChartDataTypes]>[]
[]
seriesThe series component that renders the arc components.
ReactElement<BubbleSeriesProps, FC<Partial<BubbleSeriesProps>>>
<BubbleSeries />
idId of the chart.
string
widthWidth of the chart. If not provided will autosize.
number
heightHeight of the chart. If not provided will autosize.
number
marginsMargins for the chart.
Margins
10
classNameClassnames for the chart.
string
containerClassNameClassnames for the chart.
string
styleAdditional css styles.
StyleHTMLAttributes<SVGSVGElement>
centerCenter the chart. Used mainly internally.
boolean
centerXCenter chart on X Axis only. Used mainly internally.
boolean
centerYCenter chart on Y Axis only. Used mainly internally.
boolean

BubbleSeries (opens in a new tab)

PropDescriptionDefault
idId set by the parent.
string
dataThe internal data object built by d3
HierarchyCircularNode<any>[]
animatedWhether the chart is animated or not.
boolean
true
colorSchemeColor scheme for the chart.
ColorSchemeType
cybertron
bubbleBubble element.
ReactElement<BubbleProps, FC<Partial<BubbleProps>>>
<Bubble />
formatBubble element.
(item: any) => ReactElement<BubbleProps, FC<Partial<BubbleProps>>>
labelLabel element.
ReactElement<BubbleLabelProps, FC<Partial<BubbleLabelProps>>>
<BubbleLabel />

Bubble (opens in a new tab)

PropDescriptionDefault
idId set by the parent.
string
dataThe internal data object built by d3
HierarchyCircularNode<any>
fillFill for the bubble.
string
animatedWhether the chart is animated or not.
boolean
tooltipTooltip element.
ReactElement<ChartTooltipProps, FC<Partial<ChartTooltipProps>>>
<ChartTooltip />
maskMask element for the bubble.
ReactElement<MaskProps, FC<MaskProps>>
glowGlow styling for the bubble.
Glow
gradientGradient shades for the bubble.
ReactElement<GradientProps, FC<Partial<GradientProps>>>
onClickEvent for when the bubble is clicked.
(event: MouseEvent<SVGCircleElement, MouseEvent>, currentItem?: HierarchyCircularNode<any>) => void
onMouseEnterEvent for when the mouse enters bubble.
(event: any) => void
onMouseLeaveEvent for when the mouse leaves the bubble.
(event: any) => void

BubbleLabel (opens in a new tab)

PropDescriptionDefault
idId set by the parent.
string
dataThe internal data object built by d3
HierarchyCircularNode<any>
fontSizeFont size of the text.
number
14
fontFamilyFont family of the text.
string
sans-serif
fillFill of the text.
string
wrapShould wrap text or not.
boolean
true
animatedWhether the chart is animated or not.
boolean
formatFormat label.
(data: any) => any