Struct plotters::element::CandleStick[][src]

pub struct CandleStick<X, Y: PartialOrd> { /* fields omitted */ }
Expand description

The candlestick data point element

Implementations

impl<X: Clone, Y: PartialOrd> CandleStick<X, Y>[src]

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
[src]

Create a new candlestick element, which requires the Y coordinate can be compared

  • x: The x coordinate
  • open: The open value
  • high: The high value
  • low: The low value
  • close: The close value
  • gain_style: The style for gain
  • loss_style: The style for loss
  • width: 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

impl<X, Y: PartialOrd, DB: DrawingBackend> Drawable<DB, BackendCoordOnly> for CandleStick<X, Y>[src]

fn draw<I: Iterator<Item = BackendCoord>>(
    &self,
    points: I,
    backend: &mut DB,
    _: (u32, u32)
) -> Result<(), DrawingErrorKind<DB::ErrorType>>
[src]

Actually draws the element. The key points is already translated into the image coordinate and can be used by DC directly Read more

impl<'a, X: 'a, Y: PartialOrd + 'a> PointCollection<'a, (X, Y), BackendCoordOnly> for &'a CandleStick<X, Y>[src]

type Point = &'a (X, Y)

The item in point iterator

type IntoIter = &'a [(X, Y)]

The point iterator

fn point_iter(self) -> &'a [(X, Y)][src]

framework to do the coordinate mapping

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

pub fn type_id(&self) -> TypeId[src]

Gets the TypeId of self. Read more

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

pub fn borrow(&self) -> &T[src]

Immutably borrows from an owned value. Read more

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

pub fn borrow_mut(&mut self) -> &mut T[src]

Mutably borrows from an owned value. Read more

impl<T> From<T> for T[src]

pub fn from(t: T) -> T[src]

Performs the conversion.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

pub fn into(self) -> U[src]

Performs the conversion.

impl<T> SetParameter for T

fn set<T>(&mut self, value: T) -> <T as Parameter<Self>>::Result where
    T: Parameter<Self>, 

Sets value as a parameter of self.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]

Performs the conversion.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]

Performs the conversion.