
Chart | Data shape | Use when |
|---|---|---|
Label/value pairs with rose area mode. | Use it when the dual angle/radius encoding is intentional; exact area ratios are not preserved. | |
One bounded value. | Use it for operational capacity panels. | |
Label/value pairs in polar coordinates. | Use it for cyclical categories. | |
Label/value pairs plus inner radius. | Show a small composition snapshot; supply the total separately. | |
Label/value pairs. | Use it for small composition snapshots. | |
Label/value pairs plus inner radius. | Use it when a central status label will be added by surrounding UI. | |
Label/value pairs with rose radius mode. | Use it for presentation views with few categories. | |
Vec<Vec<f32>> metric profiles. | Use it for capability or budget profiles. | |
Vec<Vec<f32>> metric profiles. | Use it when the profile shape matters. | |
One label/value pair. | Use it for health or readiness scores. | |
Label/value pairs plus inner radius. | Show one selected hierarchy level; this is a flat ring, not nested data. | |
Angle/radius samples. | Use it for direction and magnitude data. |
use fission::prelude::*;
use fission::charts::{Chart, PieSeries};
// The parent resolves display labels from its translation bundles.
fission_component! {
pub SessionDeviceOverview<()> {
props {
chart_title: String,
series_label: String,
sessions_by_device: Vec<(String, f32)>,
}
}
view(report, _state, _cx) {
let values = report.sessions_by_device.iter()
.map(|(label, value)| (label.as_str(), *value))
.collect();
} => Chart(
title: Some(report.chart_title.clone()),
series: vec![PieSeries::new(&report.series_label)
.data(values)
.inner_radius(48.0)
.into()],
)
}