pub struct Series {
pub positions: Vec<[f64; 2]>,
pub point_colors: Option<Vec<Color>>,
pub label: Option<String>,
pub color: Color,
pub marker_style: Option<MarkerStyle>,
pub line_style: Option<LineStyle>,
}Expand description
A collection of per-point styled data to be plotted.
Represents a single series of data points, which may be rendered with markers, lines, or both. The same series can contain any number of points.
Fields§
§positions: Vec<[f64; 2]>Series point positions.
point_colors: Option<Vec<Color>>Optional per-point colors. Must match the length of positions if set.
label: Option<String>Optional label for the entire series.
color: ColorColor of the entire series.
Overridden by per-point colors if they are set.
marker_style: Option<MarkerStyle>Optional marker style for the series. If none, no markers are drawn.
line_style: Option<LineStyle>Line style for connecting markers. If None, no line is drawn.
Implementations§
Source§impl Series
impl Series
Sourcepub fn new(
positions: Vec<[f64; 2]>,
marker_style: MarkerStyle,
line_style: LineStyle,
) -> Self
pub fn new( positions: Vec<[f64; 2]>, marker_style: MarkerStyle, line_style: LineStyle, ) -> Self
Create a new series with both markers and lines.
Sourcepub fn line_only(positions: Vec<[f64; 2]>, line_style: LineStyle) -> Self
pub fn line_only(positions: Vec<[f64; 2]>, line_style: LineStyle) -> Self
Create a new line-only series.
Sourcepub fn markers_only(positions: Vec<[f64; 2]>, marker_style: MarkerStyle) -> Self
pub fn markers_only(positions: Vec<[f64; 2]>, marker_style: MarkerStyle) -> Self
Create a new marker-only series.
Sourcepub fn circles(positions: Vec<[f64; 2]>, size: f32) -> Self
pub fn circles(positions: Vec<[f64; 2]>, size: f32) -> Self
Create a new series with circle markers.
Sourcepub fn squares(positions: Vec<[f64; 2]>, size: f32) -> Self
pub fn squares(positions: Vec<[f64; 2]>, size: f32) -> Self
Create a new series with square markers.
Sourcepub fn stars(positions: Vec<[f64; 2]>, size: f32) -> Self
pub fn stars(positions: Vec<[f64; 2]>, size: f32) -> Self
Create a new series with star markers.
Sourcepub fn triangles(positions: Vec<[f64; 2]>, size: f32) -> Self
pub fn triangles(positions: Vec<[f64; 2]>, size: f32) -> Self
Create a new series with triangle markers.
Sourcepub fn with_label(self, label: impl Into<String>) -> Self
pub fn with_label(self, label: impl Into<String>) -> Self
Set an label for the series.
Sourcepub fn with_marker_style(self, style: MarkerStyle) -> Self
pub fn with_marker_style(self, style: MarkerStyle) -> Self
Set the marker style for the series.
Sourcepub fn with_color(self, color: impl Into<Color>) -> Self
pub fn with_color(self, color: impl Into<Color>) -> Self
Set the color of the entire series. Overridden by per-point colors if they are set.
Sourcepub fn with_point_colors(self, colors: Vec<Color>) -> Self
pub fn with_point_colors(self, colors: Vec<Color>) -> Self
Set per-point colors for the series. Length must match the number of positions.
Sourcepub fn line_style(self, style: LineStyle) -> Self
pub fn line_style(self, style: LineStyle) -> Self
Set or change the line style for the series.
Sourcepub fn line_solid(self) -> Self
pub fn line_solid(self) -> Self
Set solid line style.
Sourcepub fn line_dotted(self, spacing: f32) -> Self
pub fn line_dotted(self, spacing: f32) -> Self
Set dotted line style with given spacing.
Sourcepub fn line_dashed(self, length: f32) -> Self
pub fn line_dashed(self, length: f32) -> Self
Set dashed line style with given dash length.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Series
impl RefUnwindSafe for Series
impl Send for Series
impl Sync for Series
impl Unpin for Series
impl UnwindSafe for Series
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.