pub struct RenkoChart { /* private fields */ }Expand description
Renko / point-and-figure chart widget.
§Example
use ratatui::{buffer::Buffer, layout::Rect, widgets::Widget};
use tui_chart::{RenkoChart};
let chart = RenkoChart::new(&[10.0, 12.0, 15.0, 13.0, 9.0], 1.0);
let area = Rect::new(0, 0, 40, 12);
let mut buf = Buffer::empty(area);
chart.render(area, &mut buf);Implementations§
Source§impl RenkoChart
impl RenkoChart
Sourcepub fn new(closes: &[f64], brick_size: f64) -> Self
pub fn new(closes: &[f64], brick_size: f64) -> Self
Build from closing prices and a fixed brick size.
Sourcepub fn from_bricks(bricks: Vec<RenkoBrick>, brick_size: f64) -> Self
pub fn from_bricks(bricks: Vec<RenkoBrick>, brick_size: f64) -> Self
Build from precomputed bricks.
Sourcepub fn down_color(self, v: Color) -> Self
pub fn down_color(self, v: Color) -> Self
Down brick / O color.
Sourcepub fn base_style(self, style: Style) -> Self
pub fn base_style(self, style: Style) -> Self
Base style painted over the whole area (beats the theme).
Sourcepub fn style(self, v: RenkoStyle) -> Self
pub fn style(self, v: RenkoStyle) -> Self
Rendering style.
Sourcepub fn brick_width(self, w: u16) -> Self
pub fn brick_width(self, w: u16) -> Self
RenkoBrick width in cells (min 1, bricks style only).
Sourcepub fn bricks(&self) -> &[RenkoBrick]
pub fn bricks(&self) -> &[RenkoBrick]
The bricks.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RenkoChart
impl RefUnwindSafe for RenkoChart
impl Send for RenkoChart
impl Sync for RenkoChart
impl Unpin for RenkoChart
impl UnsafeUnpin for RenkoChart
impl UnwindSafe for RenkoChart
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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