Skip to main content

SeriesPattern

Enum SeriesPattern 

Source
pub enum SeriesPattern {
    Solid,
    Dashed,
    Dotted,
    DashDot,
    ShortDash,
    WideDash,
}
Expand description

The non-colour visual channel identifying one chart series.

See the module docs for the rendering table and the reasoning.

Variants§

§

Solid

Unbroken line, round marker, plain fill.

§

Dashed

Long dash, square marker, forward (45°) hatch.

§

Dotted

Dotted line, triangular marker, back (135°) hatch.

§

DashDot

Dash-dot line, diamond marker, cross-hatch.

§

ShortDash

Short dash, ×-shaped marker, horizontal hatch.

§

WideDash

Wide-spaced dash, +-shaped marker, vertical hatch.

Implementations§

Source§

impl SeriesPattern

Source

pub const ALL: [SeriesPattern; 6]

Every pattern, in assignment order. The order is the cycle for_index walks.

Source

pub fn for_index(index: usize) -> Self

The pattern a series at index gets when it declares none.

Wraps, like ChartPalette::color_for does with colours — but at a different period (6 against the theme palette’s 8), so the wrap points do not coincide and (colour, pattern) stays unique far longer than either channel alone.

Source

pub fn dash(self, line_width: f32) -> Option<(f32, f32)>

The dash pattern for a stroked line, as (dash, gap) in logical pixels, or None for an unbroken line.

Scaled by line_width so a 1 dp line and a 4 dp line read as the same pattern rather than the thick one looking almost solid.

Source

pub fn marker(self) -> SeriesMarker

The marker glyph for this pattern.

Source

pub fn hatch(self) -> SeriesHatch

The hatch for a filled region carrying this pattern.

Trait Implementations§

Source§

impl Clone for SeriesPattern

Source§

fn clone(&self) -> SeriesPattern

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for SeriesPattern

Source§

impl Debug for SeriesPattern

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for SeriesPattern

Source§

fn default() -> SeriesPattern

Returns the “default value” for a type. Read more
Source§

impl Eq for SeriesPattern

Source§

impl Hash for SeriesPattern

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for SeriesPattern

Source§

fn eq(&self, other: &SeriesPattern) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for SeriesPattern

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ItemKey for T
where T: Clone + Eq + Hash + Debug + 'static,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.