pub struct SeriesSpec {
pub name: String,
pub kind: SeriesKind,
pub points: Vec<[f64; 2]>,
pub color: Option<Rgba>,
pub width: f32,
pub marker: Option<MarkerSpec>,
pub fill_opacity: f32,
pub y_axis: YAxis,
pub legend: bool,
pub baseline: f64,
pub bar_width: Option<f64>,
}Expand description
One series in a PlotSpec.
Fields§
§name: StringLegend name.
kind: SeriesKindHow the points are drawn.
points: Vec<[f64; 2]>x/y points in data units.
color: Option<Rgba>Stroke or fill color; the spec palette when None.
width: f32Stroke width in pixels.
marker: Option<MarkerSpec>Marker for scatter, or for vertices of a line.
fill_opacity: f32Fill opacity for areas and bars, 0–1.
y_axis: YAxisAxis the series is measured on.
legend: boolWhether the series appears in the legend.
baseline: f64Baseline for bars.
bar_width: Option<f64>Fixed bar width in data units; automatic when None.
Implementations§
Source§impl SeriesSpec
impl SeriesSpec
Sourcepub fn area(name: impl Into<String>, points: Vec<[f64; 2]>) -> SeriesSpec
pub fn area(name: impl Into<String>, points: Vec<[f64; 2]>) -> SeriesSpec
A filled area down to baseline.
Sourcepub fn color(self, color: Rgba) -> SeriesSpec
pub fn color(self, color: Rgba) -> SeriesSpec
Set the color.
Sourcepub fn width(self, width: f32) -> SeriesSpec
pub fn width(self, width: f32) -> SeriesSpec
Set the stroke width.
Sourcepub fn marker(self, marker: MarkerSpec) -> SeriesSpec
pub fn marker(self, marker: MarkerSpec) -> SeriesSpec
Set the marker.
Trait Implementations§
Source§impl Clone for SeriesSpec
impl Clone for SeriesSpec
Source§fn clone(&self) -> SeriesSpec
fn clone(&self) -> SeriesSpec
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 SeriesSpec
impl Debug for SeriesSpec
Source§impl Default for SeriesSpec
impl Default for SeriesSpec
Source§fn default() -> SeriesSpec
fn default() -> SeriesSpec
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for SeriesSpecwhere
SeriesSpec: Default,
impl<'de> Deserialize<'de> for SeriesSpecwhere
SeriesSpec: Default,
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<SeriesSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<SeriesSpec, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SeriesSpec
impl PartialEq for SeriesSpec
Source§impl Serialize for SeriesSpec
impl Serialize for SeriesSpec
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 SeriesSpec
Auto Trait Implementations§
impl Forget for SeriesSpec
impl Freeze for SeriesSpec
impl Move for SeriesSpec
impl RefUnwindSafe for SeriesSpec
impl Send for SeriesSpecwhere
RawVecInner: Send,
impl Sync for SeriesSpecwhere
RawVecInner: Sync,
impl Unpin for SeriesSpec
impl UnsafeUnpin for SeriesSpecwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<[f64; 2]>: UnsafeUnpin,
impl UnwindSafe for SeriesSpecwhere
RawVecInner: UnwindSafe,
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more