pub struct StackedAreaChart { /* private fields */ }Expand description
Stacked area chart widget.
§Example
use ratatui::{buffer::Buffer, layout::Rect, widgets::Widget};
use tui_chart::{AreaLayer, StackedAreaChart};
let chart = StackedAreaChart::new([AreaLayer::new("a", [1.0, 3.0, 2.0]), AreaLayer::new("b", [2.0, 1.0, 4.0])]);
let area = Rect::new(0, 0, 40, 12);
let mut buf = Buffer::empty(area);
chart.render(area, &mut buf);Implementations§
Source§impl StackedAreaChart
impl StackedAreaChart
Sourcepub fn new(layers: impl IntoIterator<Item = AreaLayer>) -> Self
pub fn new(layers: impl IntoIterator<Item = AreaLayer>) -> Self
Create a chart.
Sourcepub fn marker(self, v: Marker) -> Self
pub fn marker(self, v: Marker) -> Self
Dot resolution (default half blocks, which fill solid; use braille for finer edges).
Hide layers by index (the stack re-flows; hidden layers stay in the
legend so they can be toggled back, see Interaction).
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).
Trait Implementations§
Source§impl Clone for StackedAreaChart
impl Clone for StackedAreaChart
Source§impl Debug for StackedAreaChart
impl Debug for StackedAreaChart
Source§impl Themed for StackedAreaChart
Available on crate feature theme only.
impl Themed for StackedAreaChart
Available on crate feature
theme only.Source§fn apply_theme(self, theme: &Theme) -> Self
fn apply_theme(self, theme: &Theme) -> Self
Return
self styled from theme. Explicit per-item colors set on the
widget should keep winning over the theme.Source§fn themed(self, provider: &impl ThemeProvider) -> Self
fn themed(self, provider: &impl ThemeProvider) -> Self
Apply the theme produced by any
ThemeProvider.Source§impl Widget for &StackedAreaChart
impl Widget for &StackedAreaChart
Auto Trait Implementations§
impl Forget for StackedAreaChart
impl Freeze for StackedAreaChart
impl RefUnwindSafe for StackedAreaChart
impl Send for StackedAreaChart
impl Sync for StackedAreaChart
impl Unpin for StackedAreaChart
impl UnsafeUnpin for StackedAreaChart
impl UnwindSafe for StackedAreaChart
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