pub struct DashedLineSeries<I: Iterator + Clone, Size: SizeDesc> { /* private fields */ }
Expand description
A dashed line series, map an iterable object to the dashed line element. Can be used to draw simple dashed and dotted lines.
If you want to use more complex shapes as points in the line, you can use plotters::series::line_series::DottedLineSeries
.
§Examples
Dashed line:
chart_context
.draw_series(DashedLineSeries::new(
data_series,
5, /* size = length of dash */
10, /* spacing */
ShapeStyle {
color: BLACK.mix(1.0),
filled: false,
stroke_width: 1,
},
))
.unwrap();
Dotted line: (keep size
and stroke_width
the same to achieve dots)
chart_context
.draw_series(DashedLineSeries::new(
data_series,
1, /* size = length of dash */
4, /* spacing, best to keep this at least 1 larger than size */
ShapeStyle {
color: BLACK.mix(1.0),
filled: false,
stroke_width: 1,
},
))
.unwrap();
Implementations§
Source§impl<I: Iterator + Clone, Size: SizeDesc> DashedLineSeries<I, Size>
impl<I: Iterator + Clone, Size: SizeDesc> DashedLineSeries<I, Size>
Sourcepub fn new<I0>(points: I0, size: Size, spacing: Size, style: ShapeStyle) -> Selfwhere
I0: IntoIterator<IntoIter = I>,
pub fn new<I0>(points: I0, size: Size, spacing: Size, style: ShapeStyle) -> Selfwhere
I0: IntoIterator<IntoIter = I>,
Create a new line series from
points
: The iterator of the pointssize
: The dash sizespacing
: The dash-to-dash spacing (gap size)style
: The shape style- returns the created element
Trait Implementations§
Source§impl<I: Iterator + Clone, Size: SizeDesc> IntoIterator for DashedLineSeries<I, Size>
impl<I: Iterator + Clone, Size: SizeDesc> IntoIterator for DashedLineSeries<I, Size>
Source§type Item = DashedPathElement<I, Size>
type Item = DashedPathElement<I, Size>
The type of the elements being iterated over.
Source§type IntoIter = Once<<DashedLineSeries<I, Size> as IntoIterator>::Item>
type IntoIter = Once<<DashedLineSeries<I, Size> as IntoIterator>::Item>
Which kind of iterator are we turning this into?
Auto Trait Implementations§
impl<I, Size> Freeze for DashedLineSeries<I, Size>
impl<I, Size> RefUnwindSafe for DashedLineSeries<I, Size>where
I: RefUnwindSafe,
Size: RefUnwindSafe,
impl<I, Size> Send for DashedLineSeries<I, Size>
impl<I, Size> Sync for DashedLineSeries<I, Size>
impl<I, Size> Unpin for DashedLineSeries<I, Size>
impl<I, Size> UnwindSafe for DashedLineSeries<I, Size>where
I: UnwindSafe,
Size: 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
Layout§
Note: Unable to compute type layout, possibly due to this type having generic parameters. Layout can only be computed for concrete, fully-instantiated types.