Struct plotters::element::CandleStick
source · [−]pub struct CandleStick<X, Y: PartialOrd> { /* private fields */ }Expand description
The candlestick data point element
Implementations
sourceimpl<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
sourceimpl<X, Y: PartialOrd, DB: DrawingBackend> Drawable<DB, BackendCoordOnly> for CandleStick<X, Y>
impl<X, Y: PartialOrd, DB: DrawingBackend> Drawable<DB, BackendCoordOnly> for CandleStick<X, Y>
sourceimpl<'a, X: 'a, Y: PartialOrd + 'a> PointCollection<'a, (X, Y), BackendCoordOnly> for &'a CandleStick<X, Y>
impl<'a, X: 'a, Y: PartialOrd + 'a> PointCollection<'a, (X, Y), BackendCoordOnly> for &'a CandleStick<X, Y>
Auto Trait Implementations
impl<X, Y> RefUnwindSafe for CandleStick<X, Y> where
X: RefUnwindSafe,
Y: RefUnwindSafe,
impl<X, Y> Send for CandleStick<X, Y> where
X: Send,
Y: Send,
impl<X, Y> Sync for CandleStick<X, Y> where
X: Sync,
Y: Sync,
impl<X, Y> Unpin for CandleStick<X, Y> where
X: Unpin,
Y: Unpin,
impl<X, Y> UnwindSafe for CandleStick<X, Y> where
X: UnwindSafe,
Y: UnwindSafe,
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more