Charts plus JS behaviour

Radial bar

Concentric progress rings that sweep in one after another, each a share of its own max; the list beside it names label and value, the centre the average or the hovered ring.

Real scenarios

The component as it is used in a product — not a specimen grid.

Quarter goals

Four goals with four different targets: each ring is its share of its own max, so revenue in percent, new users against 2,000 and satisfaction against 5 sit on the same dial. The rings sweep in one after another; the centre reads the average, or the ring under the pointer, and the list beside it keeps every value readable without hovering.

Q3 goals

Progress against target

  • Revenue 82 of 100 Percent of plan
  • New users 1,240 of 2,000 Target 2,000
  • Satisfaction 4.6 of 5 Out of 5
  • Docs coverage 57 of 100
Q3 goals
ValueShare
Revenue82 of 10082%
New users1,240 of 2,00062%
Satisfaction4.6 of 592%
Docs coverage57 of 10057%

Server resources

sweep="360" closes the rings into a full dial; three rings get thicker bars automatically.

app-server-2

  • CPU 64 of 100
  • Memory 11.2 of 16 GB of 16
  • Disk 38 of 100
app-server-2
ValueShare
CPU64 of 10064%
Memory11.2 of 1670%
Disk38 of 10038%

Important props

Important props
Prop Type Default What it does
data array [] Each item: ['label' => …, 'value' => …, 'max' => …, 'hint' => …] (max and hint optional).
max / sweep number 100 / 270 The rings’ default max and the arc’s degrees (360 closes the ring).
center-value / center-label / size string average / «سهم» / 13rem The centre’s reading and the dial’s size.

Snippet

<x-nx::radial-bar title="اهداف فصل" :data="[
    ['label' => 'درآمد', 'value' => 82],
    ['label' => 'کاربر تازه', 'value' => 1240, 'max' => 2000, 'hint' => 'هدف: ۲٬۰۰۰'],
    ['label' => 'رضایت', 'value' => 4.6, 'max' => 5],
]" />