pub struct ChartRegion {
pub x_min: f64,
pub x_max: f64,
pub label: Option<String>,
pub color: Option<String>,
pub border_color: Option<String>,
}Expand description
A shaded X-range band drawn over a chart view in the HMI, used to indicate a processed / region-of-interest span of a cycle’s trace.
Serializes to the JSON shape the autocore-react ChartRegion consumes
(xMin / xMax / label / color / borderColor) — the band spans
the full Y height between x_min and x_max on the view’s x scale.
Fields§
§x_min: f64Band start on the X axis, in the view’s x-data units.
x_max: f64Band end on the X axis.
label: Option<String>Optional caption drawn at the top-center of the band.
color: Option<String>Optional fill color (any CSS color). HMI applies a default when unset.
border_color: Option<String>Optional band-edge border color (no border when unset).
Implementations§
Source§impl ChartRegion
impl ChartRegion
Sourcepub fn new(x_min: f64, x_max: f64) -> Self
pub fn new(x_min: f64, x_max: f64) -> Self
A bare band between x_min and x_max with HMI-default styling.
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Builder: set the band caption.
Sourcepub fn with_color(self, color: impl Into<String>) -> Self
pub fn with_color(self, color: impl Into<String>) -> Self
Builder: set the fill color (any CSS color string).
Sourcepub fn with_border_color(self, color: impl Into<String>) -> Self
pub fn with_border_color(self, color: impl Into<String>) -> Self
Builder: set the band-edge border color.
Trait Implementations§
Source§impl Clone for ChartRegion
impl Clone for ChartRegion
Source§fn clone(&self) -> ChartRegion
fn clone(&self) -> ChartRegion
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more