Quality operating band

A quality line needs an explicit definition of acceptable performance. A target line and operating band put that definition alongside the measurements rather than leaving a reader to judge quality from the direction of a curve. The screenshot is from Fission's chart gallery.

What the chart is for

The example measures the percentage of completed batches that passed their required checks each day. The acceptable minimum and target come from the product's quality policy, not from the chart or the most recent sample.

Data model

Compute daily percentages from passed and completed batch counts before rendering. A day with no completed batches has no denominator and must be handled separately. Keep the sample values, band and target on the same zero-to-100 scale.

Authoring from a Fission component

The parent supplies prepared values and matching reporting labels. Keep loading and calculation errors in that parent workflow.
use fission::prelude::*;
use fission::charts::{Axis, Chart, LineSeries, MarkArea, MarkLine};

// The parent resolves display labels from its translation bundles.
fission_component! {
    pub QualityOperatingBandChart<()> {
        props {
            chart_title: String,
            series_label: String,
            annotation_label: String,
            secondary_annotation_label: String,
            labels: Vec<String>,
            pass_percent: Vec<f32>,
            acceptable_min: f32,
            target_percent: f32,
        }
    }
    view(report, _state, cx) {
        let labels = report.labels.iter().map(String::as_str).collect();
        let colors = &cx.view.env().theme.tokens.colors;
    } =>
        Chart(
            title: Some(report.chart_title.clone()),
            x_axis: Some(Axis::category(labels)),
            y_axis: Some(Axis::value().min(0.0).max(100.0)),
            mark_areas: vec![MarkArea::y_range(&report.annotation_label, report.acceptable_min, 100.0)
                .color(colors.primary_subtle.with_alpha(80))],
            mark_lines: vec![MarkLine::y(&report.secondary_annotation_label, report.target_percent).color(colors.primary)],
            series: vec![
                LineSeries::new(&report.series_label)
                    .data(report.pass_percent.clone())
                    .into(),
            ],
        )
}

Testing and accessibility

Check all-pass, all-fail and no-completed-batch days. Validate that the minimum and target are in range, and show the counts behind the percentage when a small denominator could be misleading.
Tags: line, band.