#[repr(C)]pub struct ChartSeries {
pub name: String,
pub values: Vec<f32>,
pub color: Option<Rgb>,
pub goal: Option<f32>,
}Expand description
One named data series in a Widget::Chart. Cartesian styles plot values across the chart’s
x-axis labels; circular styles (pie/donut/rings/gauge) collapse the series to a single
magnitude (values summed). color overrides the auto-assigned palette slot; goal is the
denominator for Rings/Gauge progress (ignored by the other styles).
Fields§
§name: String§values: Vec<f32>§color: Option<Rgb>§goal: Option<f32>Implementations§
Source§impl ChartSeries
impl ChartSeries
Sourcepub fn new(name: impl Into<String>, values: Vec<f32>) -> ChartSeries
pub fn new(name: impl Into<String>, values: Vec<f32>) -> ChartSeries
A named series carrying values. Color falls back to the chart palette; no goal.
Sourcepub fn with_color(self, color: Rgb) -> ChartSeries
pub fn with_color(self, color: Rgb) -> ChartSeries
Override the auto-assigned palette color for this series.
Sourcepub fn with_goal(self, goal: f32) -> ChartSeries
pub fn with_goal(self, goal: f32) -> ChartSeries
Set the denominator for Rings/Gauge progress (sum(values) / goal). Ignored by
cartesian and pie/donut styles.
Trait Implementations§
Source§impl Clone for ChartSeries
impl Clone for ChartSeries
Source§fn clone(&self) -> ChartSeries
fn clone(&self) -> ChartSeries
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ChartSeries
impl Debug for ChartSeries
Source§impl<'de> Deserialize<'de> for ChartSeries
impl<'de> Deserialize<'de> for ChartSeries
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ChartSeries, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ChartSeries, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'ʄ> Facet<'ʄ> for ChartSeries
impl<'ʄ> Facet<'ʄ> for ChartSeries
Source§impl PartialEq for ChartSeries
impl PartialEq for ChartSeries
Source§impl Serialize for ChartSeries
impl Serialize for ChartSeries
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for ChartSeries
Auto Trait Implementations§
impl Freeze for ChartSeries
impl RefUnwindSafe for ChartSeries
impl Send for ChartSeries
impl Sync for ChartSeries
impl Unpin for ChartSeries
impl UnsafeUnpin for ChartSeries
impl UnwindSafe for ChartSeries
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more