pub struct Series { /* private fields */ }Expand description
One series of a BarChart: a name and one value per category.
A series takes its tone from the theme’s series palette, never from a colour the application
picks, so charts in different applications of the family read the same. By default the n-th
series takes the n-th tone; tone pins a series to one tone of the palette, so
a category keeps its colour from one chart to the next however many categories each shows.
Values shorter than the categories count as zero and values past the last category are left
out.
Implementations§
Source§impl Series
impl Series
Sourcepub fn new(
name: impl Into<String>,
values: impl IntoIterator<Item = f32>,
) -> Self
pub fn new( name: impl Into<String>, values: impl IntoIterator<Item = f32>, ) -> Self
A series called name with one value per category, in the order of the categories.
Sourcepub fn tone(self, index: usize) -> Self
pub fn tone(self, index: usize) -> Self
Takes the theme’s index-th series tone
(Theme::series_color) instead of the tone of the
series’ position. Give a category the same index everywhere — in every chart and in the
Legend beside it, through Legend::tones — and
it keeps its colour whichever other categories are shown.
Trait Implementations§
impl StructuralPartialEq for Series
Auto Trait Implementations§
impl Freeze for Series
impl RefUnwindSafe for Series
impl Send for Series
impl Sync for Series
impl Unpin for Series
impl UnsafeUnpin 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> 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> ⓘ
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> ⓘ
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