Struct plotters::element::CandleStick
source · pub struct CandleStick<X, Y: PartialOrd> { /* private fields */ }
Available on crate feature
candlestick
only.Expand description
The candlestick data point element
Implementations§
source§impl<X: Clone, Y: PartialOrd> CandleStick<X, Y>
impl<X: Clone, Y: PartialOrd> CandleStick<X, Y>
sourcepub fn new<GS: Into<ShapeStyle>, LS: Into<ShapeStyle>>(
x: X,
open: Y,
high: Y,
low: Y,
close: Y,
gain_style: GS,
loss_style: LS,
width: u32,
) -> Self
pub fn new<GS: Into<ShapeStyle>, LS: Into<ShapeStyle>>( x: X, open: Y, high: Y, low: Y, close: Y, gain_style: GS, loss_style: LS, width: u32, ) -> Self
Create a new candlestick element, which requires the Y coordinate can be compared
x
: The x coordinateopen
: The open valuehigh
: The high valuelow
: The low valueclose
: The close valuegain_style
: The style for gainloss_style
: The style for losswidth
: The width- returns The newly created candlestick element
use chrono::prelude::*;
use plotters::prelude::*;
let candlestick = CandleStick::new(Local::now(), 130.0600, 131.3700, 128.8300, 129.1500, &GREEN, &RED, 15);
Trait Implementations§
source§impl<X, Y: PartialOrd, DB: DrawingBackend> Drawable<DB> for CandleStick<X, Y>
impl<X, Y: PartialOrd, DB: DrawingBackend> Drawable<DB> for CandleStick<X, Y>
source§impl<'a, X: 'a, Y: PartialOrd + 'a> PointCollection<'a, (X, Y)> for &'a CandleStick<X, Y>
impl<'a, X: 'a, Y: PartialOrd + 'a> PointCollection<'a, (X, Y)> for &'a CandleStick<X, Y>
Auto Trait Implementations§
impl<X, Y> Freeze for CandleStick<X, Y>
impl<X, Y> RefUnwindSafe for CandleStick<X, Y>where
X: RefUnwindSafe,
Y: RefUnwindSafe,
impl<X, Y> Send for CandleStick<X, Y>
impl<X, Y> Sync for CandleStick<X, Y>
impl<X, Y> Unpin for CandleStick<X, Y>
impl<X, Y> UnwindSafe for CandleStick<X, Y>where
X: UnwindSafe,
Y: 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
source§impl<'b, T, DB, Coord> IntoDynElement<'b, DB, Coord> for Twhere
T: Drawable<DB> + 'b,
&'a T: for<'a> PointCollection<'a, Coord>,
Coord: Clone,
DB: DrawingBackend,
impl<'b, T, DB, Coord> IntoDynElement<'b, DB, Coord> for Twhere
T: Drawable<DB> + 'b,
&'a T: for<'a> PointCollection<'a, Coord>,
Coord: Clone,
DB: DrawingBackend,
source§fn into_dyn(self) -> DynElement<'b, DB, Coord>
fn into_dyn(self) -> DynElement<'b, DB, Coord>
Make the conversion