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
impl SeriesPattern
Sourcepub const ALL: [SeriesPattern; 6]
pub const ALL: [SeriesPattern; 6]
Every pattern, in assignment order. The order is the cycle
for_index walks.
Sourcepub fn for_index(index: usize) -> Self
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.
Sourcepub fn dash(self, line_width: f32) -> Option<(f32, f32)>
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.
Sourcepub fn marker(self) -> SeriesMarker
pub fn marker(self) -> SeriesMarker
The marker glyph for this pattern.
Sourcepub fn hatch(self) -> SeriesHatch
pub fn hatch(self) -> SeriesHatch
The hatch for a filled region carrying this pattern.
Trait Implementations§
Source§impl Clone for SeriesPattern
impl Clone for SeriesPattern
Source§fn clone(&self) -> SeriesPattern
fn clone(&self) -> SeriesPattern
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for SeriesPattern
Source§impl Debug for SeriesPattern
impl Debug for SeriesPattern
Source§impl Default for SeriesPattern
impl Default for SeriesPattern
Source§fn default() -> SeriesPattern
fn default() -> SeriesPattern
impl Eq for SeriesPattern
Source§impl Hash for SeriesPattern
impl Hash for SeriesPattern
Source§impl PartialEq for SeriesPattern
impl PartialEq for SeriesPattern
Source§fn eq(&self, other: &SeriesPattern) -> bool
fn eq(&self, other: &SeriesPattern) -> bool
self and other values to be equal, and is used by ==.