Skip to Content

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Β 

NameTypeDefault
dataChartShallowDataShape[]

Data the chart will receive to render.

[]
seriesReactElement<BubbleSeriesProps, FC<Partial<BubbleSeriesProps>>>

The series component that renders the arc components.

`<BubbleSeries />`
idstring

Id of the chart.

widthnumber

Width of the chart. If not provided will autosize.

heightnumber

Height of the chart. If not provided will autosize.

marginsMargins

Margins for the chart.

classNamestring

Classnames for the chart.

containerClassNamestring

Classnames for the chart.

styleStyleHTMLAttributes<SVGSVGElement>

Additional css styles.

centerboolean

Center the chart. Used mainly internally.

centerXboolean

Center chart on X Axis only. Used mainly internally.

centerYboolean

Center chart on Y Axis only. Used mainly internally.

BubbleSeriesΒ 

NameTypeDefault
idstring

Id set by the parent.

dataHierarchyCircularNode<any>[]

The internal data object built by d3

animatedboolean

Whether the chart is animated or not.

true
colorSchemeColorSchemeType

Color scheme for the chart.

'cybertron'
bubbleReactElement<BubbleProps, FC<Partial<BubbleProps>>>

Bubble element.

`<Bubble />`
format(item: any) => ReactElement<BubbleProps, FC<Partial<BubbleProps>>>

Bubble element.

labelReactElement<BubbleLabelProps, FC<Partial<BubbleLabelProps>>>

Label element.

`<BubbleLabel />`

BubbleΒ 

NameTypeDefault
idstring

Id set by the parent.

dataHierarchyCircularNode<any>

The internal data object built by d3

fillstring

Fill for the bubble.

animatedboolean

Whether the chart is animated or not.

tooltipReactElement<ChartTooltipProps, FC<Partial<ChartTooltipProps>>> | null

Tooltip element.

`<ChartTooltip />`
maskReactElement<MaskProps, FC<MaskProps>> | null

Mask element for the bubble.

glowGlow

Glow styling for the bubble.

gradientReactElement<GradientProps, FC<Partial<GradientProps>>> | null

Gradient shades for the bubble.

onClick(event: MouseEvent<SVGCircleElement, MouseEvent>, currentItem?: HierarchyCircularNode<any> | undefined) => void

Event for when the bubble is clicked.

onMouseEnter(event: any) => void

Event for when the mouse enters bubble.

onMouseLeave(event: any) => void

Event for when the mouse leaves the bubble.

BubbleLabelΒ 

NameTypeDefault
idstring

Id set by the parent.

dataHierarchyCircularNode<any>

The internal data object built by d3

fontSizenumber

Font size of the text.

14
fontFamilystring

Font family of the text.

'sans-serif'
fillstring

Fill of the text.

wrapboolean

Should wrap text or not.

true
animatedboolean

Whether the chart is animated or not.

format(data: any) => any

Format label.

Last updated on