Skip to main content

QCustomBubbleChart

Pro widget

QCustomBubbleChart ships in Custom Widgets Pro. It is not part of the free GPLv3 package from 2.6.0 onward — the free package keeps the import path so Qt Designer forms still load, and installing Pro activates the widget with no code change. Releases up to 2.5.0 included it under the GPLv3.

Pro is licensed software and is not installable from PyPI — the name there is a pointer package with no widgets in it. Licence holders download the wheel from their account:

# https://portal.customwidgets.org/downloads
pip install <the downloaded .whl>

See plans

QCustomBubbleChart

An interactive packed-circle (bubble) chart.

The sentiment / share bubble cloud: one circle per item, AREA proportional to the value, coloured by category and labelled inside when big enough. Circles are packed by a small deterministic force relaxation (push overlaps apart + gravity to a per-category anchor when grouped), then scaled to fill the widget.

INTERACTIVE (the reference has all of these):

  • hover -> a CUSTOM painted tooltip card (never the OS QToolTip), plus a grow animation + glow on the hovered bubble.
  • zoom -> wheel zooms toward the cursor, a painted +/- control, drag to pan, double-click to reset. zoomIn()/zoomOut()/resetView().
  • search -> setSearchQuery(text) dims the non-matching bubbles; the painted search button emits searchRequested().
  • scale -> optional category grouping (groupByCategory) + axis labels.

setItems([{label, value, category}]) / itemsJson; colours via setCategoryColors({category: colour}). Signals: bubbleClicked(label), searchRequested(), zoomChanged(float).

At a glance​

TierPro
Importfrom Custom_Widgets.QCustomBubbleChart import QCustomBubbleChart
Qt DesignerYes — drag it from the palette

Quick start​

from Custom_Widgets.QCustomBubbleChart import QCustomBubbleChart

widget = QCustomBubbleChart()

Dark theme​

Colours come from the design tokens, so the widget follows the app theme with no extra work.

QCustomBubbleChart in dark theme

Properties​

Every property below is settable in code and in Qt Designer.

PropertyTypeDefault
itemsJsonstring—
categoriesJsonstring—
paddingfloat3.0
showLabelsboolTrue
minLabelRadiusfloat16.0
labelColorcolor#ffffff
defaultColorcolor#8b90a0
shadeVariationfloat0.18
hoverGlowboolTrue
hoverScalefloat1.16
groupByCategoryboolFalse
zoomableboolTrue
showControlsboolTrue
searchQuerystring—
tooltipsboolTrue
tooltipBgColorcolor#0e1016
controlColorcolor#f4f6fb

Signals​

Signal
bubbleClicked(QString)
searchRequested()
zoomChanged(double)

Methods​

MethodDescription
bubbleClicked(...)Bubble clicked.
categoriesJson(*args, **kwargs)Categories json.
controlColor(*args, **kwargs)Control color.
defaultColor(*args, **kwargs)Default color.
groupByCategory(*args, **kwargs)Group by category.
hoverGlow(*args, **kwargs)Hover glow.
hoverScale(*args, **kwargs)Hover scale.
items()Items.
itemsJson(*args, **kwargs)Items json.
labelColor(*args, **kwargs)Label color.
minLabelRadius(*args, **kwargs)Min label radius.
padding(*args, **kwargs)Padding.
resetView()Reset the view.
searchQuery(*args, **kwargs)Search query.
searchRequested(...)Search requested.
setCategoryColors(mapping)Set the category colors.
setItems(items)Set the items.
setSearchQuery(text)Set the search query.
shadeVariation(*args, **kwargs)Shade variation.
showControls(*args, **kwargs)Show the controls.
showLabels(*args, **kwargs)Show the labels.
tooltipBgColor(*args, **kwargs)Tooltip bg color.
tooltips(*args, **kwargs)Tooltips.
zoomChanged(...)Zoom changed.
zoomIn()Zoom in.
zoomOut()Zoom out.
zoomable(*args, **kwargs)Zoomable.

QCustomAreaChart · QCustomBarChart · QCustomBeeswarm · QCustomCandlestickChart · QCustomCompass · QCustomCompassDial · QCustomDivergingBarChart · QCustomDonut