Skip to main content

QCustomRadialBars

Pro widget

QCustomRadialBars ships in Custom Widgets Pro. The free package under GPLv3 does not include it.

See plans

QCustomRadialBars

A painted radial bar chart.

Concentric arcs, one per category, each sweeping in proportion to its value. The "activity rings" form: compact, reads at a glance, and unlike a pie it compares values that do NOT sum to a whole.

QPainter only, NO QtCharts (see docs/design/mui-charts-gap.md). Angles come from the shared _chart_axis polar helpers, so this winds the same way as QCustomRadarChart and QCustomRadialLines.

Data goes in with setBars([...]) in code, or barsCsv in Qt Designer:

barsCsv = "Move=82,Exercise=64,Stand=95"

Emits barHovered(int) and barClicked(int); -1 means "nothing".

At a glance

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

Quick start

from Custom_Widgets.QCustomRadialBars import QCustomRadialBars

widget = QCustomRadialBars()

Dark theme

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

QCustomRadialBars in dark theme

Properties

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

PropertyTypeDefault
barsCsvstring
colorsCsvstring
maxValuefloat100.0
startAngleint90
clockwiseboolTrue
thicknessint18
spacingint6
holeRatiofloat0.35
roundedboolTrue
showTrackboolTrue
showLabelsboolTrue
showValuesboolTrue
trackColorcolor#e2e8f0
labelColorcolor#0f172a

Signals

Signal
barClicked(int)
barHovered(int)

Methods

MethodDescription
barAt(pos)Index of the ring under a point, or -1.
barClicked(...)Bar clicked.
barColor(index)Bar color.
barCount()Bar count.
barHovered(...)Bar hovered.
bars()Bars.
barsCsv(*args, **kwargs)Bars csv.
clearBars()Clear the bars.
clockwise(*args, **kwargs)Clockwise.
colorsCsv(*args, **kwargs)Colors csv.
fractionFor(index)0..1 of the maximum. Values above the maximum are clamped so a bar
holeRatio(*args, **kwargs)Hole ratio.
labelColor(*args, **kwargs)Label color.
maxValue(*args, **kwargs)Max value.
maximum()Maximum.
ringRect(index)Bounding rect of ring index, outermost first.
rounded(*args, **kwargs)Rounded.
setBars(bars)Set the bars.
showLabels(*args, **kwargs)Show the labels.
showTrack(*args, **kwargs)Show the track.
showValues(*args, **kwargs)Show the values.
spacing(*args, **kwargs)Spacing.
startAngle(*args, **kwargs)Start the angle.
thickness(*args, **kwargs)Thickness.
trackColor(*args, **kwargs)Track color.

Theming

Colours come from the design tokens, so they follow the active theme. Roles used: accent, surface-muted, on-surface.

See Design tokens.

Runnable example

A complete app using this widget lives at examples/PySide6/QCustomRadialBars/main.py.

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