Chart

Struct Chart 

Source
pub struct Chart { /* private fields */ }

Implementations§

Source§

impl Chart

Source

pub fn new(candles: &[Candle]) -> Self

Source

pub fn draw(&self)

Draws the chart by outputting multiples strings in the terminal.

Source

pub fn set_name(&mut self, name: String)

Set the name of the chart in the info bar.

Source

pub fn set_bear_color(&mut self, r: u8, g: u8, b: u8)

Set the color of the bearish candle The default color is (234, 74, 90).

Source

pub fn set_bull_color(&mut self, r: u8, g: u8, b: u8)

Set the color of the bullish candle The default color is (52, 208, 88).

Source

pub fn set_vol_bear_color(&mut self, r: u8, g: u8, b: u8)

Sets the color of the volume when the candle is bearish. The default color is (234, 74, 90).

Source

pub fn set_vol_bull_color(&mut self, r: u8, g: u8, b: u8)

Sets the color of the volume when the candle is bullish. The default color is (52, 208, 88).

Source

pub fn set_volume_pane_enabled(&mut self, enabled: bool)

Hide or show the volume pane.

Source

pub fn set_volume_pane_unicode_fill(&mut self, unicode_fill: char)

Set the character for drawing the volume bars.

Source

pub fn set_volume_pane_height(&mut self, height: i64)

Set the volume pane height. Default is 1/6 of the terminal height.

Auto Trait Implementations§

§

impl Freeze for Chart

§

impl !RefUnwindSafe for Chart

§

impl !Send for Chart

§

impl !Sync for Chart

§

impl Unpin for Chart

§

impl !UnwindSafe for Chart

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

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

Performs the conversion.