
Field | Type | Notes |
|---|---|---|
title | &str | Names the chart for the screen, accessibility tree, and test output. |
x_axis | Axis::value() | Maps the first point dimension. |
y_axis | Axis::value() | Maps the second point dimension. |
series | ScatterSeries / BubbleSeries / EffectScatterSeries | Chooses fixed points, sized bubbles, or emphasized points. |
width / height | f32 | Optional fixed size; omit them when the chart should flex inside Fission layout. |
use fission::charts::{Axis, BubbleSeries, Chart, VisualMap};
let chart = Chart::new()
.title("Bubble scatter")
.x_axis(Axis::value())
.y_axis(Axis::value())
.visual_map(VisualMap::new().min(10.0).max(80.0))
.series(vec![BubbleSeries::new("Markets")
.data(vec![(10.0, 8.0, 22.0), (18.0, 12.0, 46.0), (32.0, 22.0, 74.0)])
.radius_range(6.0, 24.0)
.into()]);
use fission::prelude::*;
use fission::charts::{Axis, BubbleSeries, Chart, VisualMap};
pub struct BubbleScatterChart;
impl From<BubbleScatterChart> for Widget {
fn from(_: BubbleScatterChart) -> Widget {
Chart::new()
.title("Bubble scatter")
.x_axis(Axis::value())
.y_axis(Axis::value())
.visual_map(VisualMap::new().min(10.0).max(80.0))
.series(vec![BubbleSeries::new("Markets")
.data(vec![(10.0, 8.0, 22.0), (18.0, 12.0, 46.0), (32.0, 22.0, 74.0)])
.radius_range(6.0, 24.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. |