
Chart | Data shape | Use when |
|---|---|---|
Vec<f32> plus area style. | Use it when total volume is as important as the outline. | |
BarSeries values plus background and border-radius styling. | Use it for progress-like category comparisons where the maximum should remain visible. | |
Vec<f32> aligned to category labels. | Use it when individual values need easy comparison. | |
Vec<f32> on a category, value, or time axis. | Use it when the shape of change matters more than individual bars. | |
Multiple bar series sharing the same category axis. | Use it to compare related measures within each group. | |
BarSeries values with a category y-axis and value x-axis. | Use it when category labels are long or ranking order is more important than time order. | |
A longer Vec<f32> aligned to ordered category samples. | Use it for telemetry, monitoring, and sampled metrics where the trend matters more than every label. | |
Numeric values plus symbol choice. | Use it when the chart should feel branded without giving up scale. | |
BarSeries values that may be positive or negative. | Use it for deltas, profit/loss, variance, and month-over-month movement. | |
Vec<f32> with smooth interpolation enabled. | Use it for dashboards where the series is sampled often enough to justify interpolation. | |
Several line series sharing one stack key. | Use it to show composition over time without losing the total. | |
Multiple bar series sharing one stack key. | Use it to show composition and total at the same time. | |
Vec<f32> with start, middle, or end step behavior. | Use it for counters, states, quotas, and event-driven changes. |
use fission::prelude::*;
use fission::charts::{Axis, Chart, LineSeries};
pub struct CartesianChart;
impl From<CartesianChart> for Widget {
fn from(_: CartesianChart) -> Widget {
Chart::new()
.title("Cartesian")
.x_axis(Axis::category(vec!["A", "B", "C"]))
.y_axis(Axis::value())
.series(vec![LineSeries::new("Series").data(vec![1.0, 2.0, 3.0]).into()])
.into()
}
}
Area | What to decide | How to verify |
|---|---|---|
Data shape | Keep source rows in typed Rust structs, then map them into the series type shown in the example. | Unit test the mapping separately from rendering. |
Options | Choose axes, legends, labels, animation, and interaction based on the user's task. | Add a screenshot test when changing visual behavior. |
Accessibility | Provide a clear title and adjacent summary text for important trends or outliers. | Inspect the generated semantics and make sure the chart is understandable without color alone. |
Failure handling | Render an empty, loading, or error state before constructing the chart if data is unavailable. | Test empty data, partial data, and failed fetches. |
Performance | Prefer summarized or windowed data for very large datasets; keep full raw history in the data layer. | Profile frame time and interaction latency with representative data volumes. |