
Field | Type | Notes |
|---|---|---|
title | &str | Names the chart for the screen, accessibility tree, and test output. |
data_zoom | DataZoom | Sets the visible percentage range for ordered data. |
width / height | f32 | Optional fixed size; omit them when the chart should flex inside Fission layout. |
use fission::charts::{Axis, Chart, DataZoom, LineSeries};
let chart = Chart::new()
.title("Data zoom")
.x_axis(Axis::category(vec!["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug"]))
.y_axis(Axis::value())
.data_zoom(DataZoom::new().start_percent(18.0).end_percent(82.0))
.series(vec![LineSeries::new("Requests").data(vec![120.0, 142.0, 118.0, 190.0, 240.0, 220.0, 260.0, 310.0]).into()]);
use fission::prelude::*;
use fission::charts::{Axis, Chart, DataZoom, LineSeries};
pub struct DataZoomChart;
impl From<DataZoomChart> for Widget {
fn from(_: DataZoomChart) -> Widget {
Chart::new()
.title("Data zoom")
.x_axis(Axis::category(vec!["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug"]))
.y_axis(Axis::value())
.data_zoom(DataZoom::new().start_percent(18.0).end_percent(82.0))
.series(vec![LineSeries::new("Requests").data(vec![120.0, 142.0, 118.0, 190.0, 240.0, 220.0, 260.0, 310.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. |