hydroxy

Radial charts

GaugeChart shows one value on an arc in three styles: a thermometer fill coloured by the threshold band it has reached, segmented status bands with a pointer, or a needle that sweeps to the value and settles. RadialBarChart stacks progress rings, the first outermost; below a full turn each ring is an arc labelled at its start. Hover, touch or focus either to read the value in a tooltip. For parts of a whole, use the donut chart.

Support SLA met

Share of tickets answered inside the target time.

SLA met this week
MeasureValueBand
SLA met this week94%90%–100%
SLA met last week
MeasureValueBand
SLA met last week78%70%–90%
SLA met two weeks ago
MeasureValueBand
SLA met two weeks ago52%0%–70%

Backlog cleared

Step through the last three sprints.

Backlog cleared this sprint
MeasureValueBand
Backlog cleared this sprint38%0%–70%

Server load

One reading in three gauge styles: arc, segmented status bands and needle.

CPU load, arc
MeasureValueBand
CPU load, arc47%0%–60%
CPU load, segmented
MeasureValueBand
CPU load, segmented47%0%–60%
CPU load, needle
MeasureValueBand
CPU load, needle47%0%–60%

Research goals

Progress against a target of 100 each.

Progress towards each research goal
NameValueMaxShare
Interviews4210042%
Surveys2810028%
Tickets6510065%
Reviews1210012%

Research goals, as arcs

Three-quarter arcs with each label at its arc's start.

Progress towards each research goal, as arcs
NameValueMaxShare
Interviews4210042%
Surveys2810028%
Tickets6510065%
Reviews1210012%

Usage

use hydroxy_leptos::button::*;
use hydroxy_leptos::chart_frame::ChartFrame;
use hydroxy_leptos::radial_chart::*;
use leptos::prelude::*;

pub fn demo() -> AnyView {
    let goals = vec![
        Datum::new("Interviews", 42.0),
        Datum::new("Surveys", 28.0),
        Datum::new("Tickets", 65.0),
        Datum::new("Reviews", 12.0),
    ];
    // The arc takes the colour of the highest band the value has reached.
    let bands = || {
        vec![
            Threshold::new(0.0, "var(--status-danger)"),
            Threshold::new(70.0, "var(--status-warning)"),
            Threshold::new(90.0, "var(--status-success)"),
        ]
    };

    let arcs = goals.clone();
    // Low load is good here, so the bands run green to red.
    let load_bands = || {
        vec![
            Threshold::new(0.0, "var(--status-success)"),
            Threshold::new(60.0, "var(--status-warning)"),
            Threshold::new(85.0, "var(--status-danger)"),
        ]
    };
    // The needle swings to each new reading and settles.
    let tick = RwSignal::new(0_usize);
    let load = Signal::derive(move || [47.0, 72.0, 91.0, 28.0][tick.get() % 4]);

    // A changed value glides along the arc.
    let week = RwSignal::new(0_usize);
    let backlog = Signal::derive(move || [38.0, 64.0, 91.0][week.get() % 3]);

    view! {
        <div style="display: grid; gap: var(--space-8);">
            <ChartFrame title="Support SLA met" description="Share of tickets answered inside the target time.">
                <div style="display: flex; flex-wrap: wrap; gap: var(--space-8);">
                    <GaugeChart value=94.0 label="SLA met this week" caption="this week" thresholds=bands() format=|v: f64| format!("{v:.0}%") />
                    <GaugeChart value=78.0 label="SLA met last week" caption="last week" thresholds=bands() format=|v: f64| format!("{v:.0}%") />
                    <GaugeChart value=52.0 label="SLA met two weeks ago" caption="two weeks ago" thresholds=bands() format=|v: f64| format!("{v:.0}%") />
                </div>
            </ChartFrame>
            <ChartFrame title="Backlog cleared" description="Step through the last three sprints.">
                <div style="display: flex; align-items: center; flex-wrap: wrap; gap: var(--space-6);">
                    <GaugeChart value=backlog label="Backlog cleared this sprint" caption="of planned work" thresholds=bands() format=|v: f64| format!("{v:.0}%") />
                    <Button variant=ButtonVariant::Secondary on_click=move |_| week.update(|w| *w += 1)>"Next sprint"</Button>
                </div>
            </ChartFrame>
            <ChartFrame title="Server load" description="One reading in three gauge styles: arc, segmented status bands and needle.">
                <div style="display: flex; flex-wrap: wrap; gap: var(--space-8);">
                    <GaugeChart value=load label="CPU load, arc" caption="CPU" thresholds=load_bands() format=|v: f64| format!("{v:.0}%") />
                    <GaugeChart value=load label="CPU load, segmented" caption="CPU" thresholds=load_bands() variant=GaugeVariant::Segmented format=|v: f64| format!("{v:.0}%") />
                    <GaugeChart value=load label="CPU load, needle" caption="CPU" thresholds=load_bands() variant=GaugeVariant::Needle format=|v: f64| format!("{v:.0}%") />
                </div>
                <Button variant=ButtonVariant::Secondary on_click=move |_| tick.update(|t| *t += 1)>"New reading"</Button>
            </ChartFrame>
            <ChartFrame title="Research goals" description="Progress against a target of 100 each.">
                <RadialBarChart data=goals max=100.0 label="Progress towards each research goal" />
            </ChartFrame>
            <ChartFrame title="Research goals, as arcs" description="Three-quarter arcs with each label at its arc's start.">
                <RadialBarChart data=arcs max=100.0 sweep=270.0 size=240 label="Progress towards each research goal, as arcs" />
            </ChartFrame>
        </div>
    }
    .into_any()
}

Anatomy

Componentdata-partRenders
GaugeChartrootFocusable role=meter with the value, range and a text value; `data-active` while read
trackFull three-quarter arc behind the value
value-arcFilled share, in the colour of the active threshold band
markA tick where each threshold starts
centerThe value, with an optional caption
segmentSegmented and needle styles: one threshold band; segmented lights the band holding the value
pointerSegmented style: the marker at the value
needleNeedle style: the arm and hub, turned to the value
tooltipValue and threshold band, at the tip of the arc
RadialBarChartrootfigure; `data-active` while a ring is picked
plotFocusable group holding the rings and tooltip
ringTrack and fill for one value; hover, touch or keys pick it out with its legend row
ring-labelThe ring's name at its arc start, when sweep is 270 or less
tooltipValue and share of the full ring, at the end of its fill
legendSwatch, label, value and share of the full ring
Bothsr-liveAnnounces the value being read
sr-tableEvery value with its band or share, for screen readers and CSV export

Keyboard

KeyDoes
TabGaugeChart: focus shows the tooltip
ArrowRight / ArrowLeftRadialBarChart: next or previous ring
Home / EndRadialBarChart: first or last ring
EscapeClear the tooltip

Props

PropTypeNotes
valuef64GaugeChart. Required. The current value
min / maxf64GaugeChart. The scale. Default 0 to 100
thresholdsVec<Threshold>GaugeChart. Threshold::new(from, css colour); the highest band reached wins
captionStringGaugeChart. Text under the centre value
variantGaugeVariantGaugeChart. Arc (default), Segmented or Needle
dataVec<Datum>RadialBarChart. Required. One ring per datum, outermost first
maxf64RadialBarChart. What a full ring means. Default: the largest value
sweepf64RadialBarChart. Degrees a full ring covers. Default 360; at 270 or less labels sit at the arc starts
labelStringRequired on both. What the chart shows; the accessible name
size / thicknessu16Diameter and arc width in px
formatFn(f64) -> StringFormats values, scale ends, tooltips and the table

Events

PropTypeNotes
on_hoverCallback<Option<Datum>>The mark under the pointer or keyboard focus changes, or is left. Fires only on a change
on_selectCallback<Datum>Click, tap or Enter on a mark
Actions
Button
Icon button
Toolbar
Theme menu
Display
Avatar
Badge
Card
Chip
Code block
Markdown
Doc card
Due pill
Kbd
Priority mark
Source chip
Space icon
Status diamond
Tag
Value diff
Carousel
Reveal
Media timeline
QR code
Transcript viewer
Audio waveform
Audio player
Forms
Calendar
Checkbox
Combobox
Date picker
Color picker
Cron builder
Theme editor
Mention input
Signature pad
Image cropper
Date field
Date range picker
Duration field
Quantity stepper
Filter chip
Input
Markdown editor
Radio group
Search field
Segmented control
Select
Slider
Range slider
Rating
Toggle button
File dropzone
Upload queue
Attachment
Switch
Tags input
Number field
Money field
Phone field
Time field
OTP input
Password field
Questionnaire
Availability picker
Voice input
Recording control
Inline edit
Async validated input
Shortcut recorder
Data
Spreadsheet grid
Week scheduler
Virtual list
Stat card
Step track
Kanban board
Sortable list
Filter builder
Data table
Grid
Access editor
File manager
Gantt chart
Log stream
Diff viewer
JSON inspector
Terminal
Node editor
Whiteboard
Navigation
Table of contents
Breadcrumb
Tabs
Wizard
Nav item
Nav section
Tree view
Pagination
Menubar
Navigation menu
Saved views
Layout
Master detail
App shell
Sidebar layout
Resizable panels
Dashboard layout
Dock layout
Feedback
Callout
Check list
Empty state
Progress bar
Toast
Approval card
Skeleton
Notification center
Bars
Bar chart
Diverging bar chart
Span chart
Pictogram chart
Stacked bar chart
Funnel chart
Bullet chart
Waffle chart
Marimekko chart
Dot plot chart
Error bar chart
Pareto chart
Waterfall chart
Lollipop chart
Grouped bar chart
Bar race chart
KPIs and frames
Chart frame
Metric card
Sparkline
Points
Scatter chart
Smith chart
Strip plot
Beeswarm chart
Parallel coordinates
Ternary chart
Bland-Altman chart
Quiver chart
Connected scatter chart
Grids and tables
Heatmap chart
Chart table
Cohort chart
Radial
Radial charts
Radar chart
Polar area chart
Stat ring
Clock chart
Spiral chart
Lines and areas
Bump chart
Slope chart
Line chart
Composed chart
Small multiples
Cycle plot chart
Horizon chart
Stacked area chart
Threshold chart
Split line chart
Linked charts
Confidence band chart
Forecast fan chart
Step chart
Range area chart
Distributions
Contour chart
Histogram
Box plot
Density chart
Ridgeline chart
Violin chart
Q-Q chart
Survival chart
ECDF chart
Raincloud plot
Forest plot
Maps
Geo map
Bubble map
Hexbin map
Cartogram
Flow map
Parts of a whole
Donut chart
Voronoi treemap
Nested donut chart
Treemap chart
Sunburst chart
Bubble pack chart
Icicle chart
Flame graph chart
Pie chart
Word cloud
Relationships
Sankey chart
Network chart
Chord chart
UpSet chart
Venn chart
Alluvial chart
Adjacency matrix chart
Dependency graph chart
Tree chart
Arc diagram
Hive plot
Edge bundling
Finance
Candlestick chart
OHLC chart
Depth chart
Renko chart
Time
Timeline chart
Calendar heatmap chart
Spectrogram chart
Marey chart
Overlays
Tour
Lightbox
Alert dialog
Command palette
Dialog
Menu
Popover
Tooltip
Sheet
Hover card
Context menu
Utilities
Pacer
Hotkeys
Disclosure
Accordion
Collapsible
Chat
Chat bubble
Voice session
Composer
Thread
Thread list
Assistant composer
Assistant MCP
Assistant modal
Assistant thread
Assistant thread list
Message scroller
Insight note
Emoji picker
Tool trace
Model picker
Citation popover
Activity
Activity feed
Comment thread
Timeline
Presence bar
Live cursors
Reaction bar
Guides
Getting started
All components
All charts