pub struct LineChart { /* private fields */ }Expand description
Multi-series line / step / area / scatter chart with sub-cell resolution.
§Example
use ratatui::{buffer::Buffer, layout::Rect, widgets::Widget};
use tui_chart::{LineChart, Series};
let chart = LineChart::new(vec![Series::new("squares").data((0..10).map(|i| (i as f64, (i * i) as f64)))]);
let area = Rect::new(0, 0, 40, 12);
let mut buf = Buffer::empty(area);
chart.render(area, &mut buf);Implementations§
Source§impl LineChart
impl LineChart
Sourcepub fn y2_axis(self, axis: Axis) -> Self
pub fn y2_axis(self, axis: Axis) -> Self
Secondary (right) y axis configuration, used by secondary_axis(true) series.
Sourcepub fn y_log(self, v: bool) -> Self
pub fn y_log(self, v: bool) -> Self
Logarithmic (base 10) primary y axis with decade ticks. Non-positive values are not drawn.
Sourcepub fn annotation(self, annotation: Annotation) -> Self
pub fn annotation(self, annotation: Annotation) -> Self
Add an annotation (reference line, region or label).
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 legend_style(self, v: Style) -> Self
pub fn legend_style(self, v: Style) -> Self
Style of legend entry text (default: theme muted color / gray).
Sourcepub fn legend(self, v: LegendPosition) -> Self
pub fn legend(self, v: LegendPosition) -> Self
Legend placement.
Sourcepub fn bounds(&self) -> ((f64, f64), (f64, f64))
pub fn bounds(&self) -> ((f64, f64), (f64, f64))
Resolved (x_bounds, y_bounds) (primary axis, data coordinates).
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for LineChart
impl !UnwindSafe for LineChart
impl Freeze for LineChart
impl Send for LineChart
impl Sync for LineChart
impl Unpin for LineChart
impl UnsafeUnpin for LineChart
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