Struct DashedLineSeries
pub struct DashedLineSeries<I, Size>{ /* 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§
§impl<I, Size> DashedLineSeries<I, Size>
impl<I, Size> DashedLineSeries<I, Size>
pub fn new<I0>(
points: I0,
size: Size,
spacing: Size,
style: ShapeStyle,
) -> DashedLineSeries<I, Size>where
I0: IntoIterator<IntoIter = I>,
pub fn new<I0>(
points: I0,
size: Size,
spacing: Size,
style: ShapeStyle,
) -> DashedLineSeries<I, Size>where
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§
§impl<I, Size> IntoIterator for DashedLineSeries<I, Size>
impl<I, Size> IntoIterator for DashedLineSeries<I, Size>
§type Item = DashedPathElement<I, Size>
type Item = DashedPathElement<I, Size>
The type of the elements being iterated over.
§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?
§fn into_iter(self) -> <DashedLineSeries<I, Size> as IntoIterator>::IntoIter
fn into_iter(self) -> <DashedLineSeries<I, Size> as IntoIterator>::IntoIter
Creates an iterator from a value. Read more
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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