pub struct RadarChart<'a> { /* private fields */ }Expand description
Spider chart with N axes and any number of series.
§Example
use ratatui::{buffer::Buffer, layout::Rect, widgets::Widget};
use tui_chart::{RadarChart, RadarSeries};
let chart = RadarChart::new(["Speed", "Power", "Armor"]).series(RadarSeries::new("A", [3.0, 7.0, 5.0]));
let area = Rect::new(0, 0, 40, 12);
let mut buf = Buffer::empty(area);
chart.render(area, &mut buf);Implementations§
Source§impl<'a> RadarChart<'a>
impl<'a> RadarChart<'a>
Sourcepub fn new(axes: impl IntoIterator<Item = impl Into<String>>) -> Self
pub fn new(axes: impl IntoIterator<Item = impl Into<String>>) -> Self
Create a chart from axis labels.
Sourcepub fn series(self, s: RadarSeries) -> Self
pub fn series(self, s: RadarSeries) -> Self
Add a series.
Sourcepub fn show_labels(self, v: bool) -> Self
pub fn show_labels(self, v: bool) -> Self
Show axis labels.
Sourcepub fn theme(self, theme: impl Into<Theme>) -> Self
pub fn theme(self, theme: impl Into<Theme>) -> Self
Apply a Theme: palette series colors, grid/label colors and
background fill. Explicit RadarSeries::color wins.
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 marker(self, v: Marker) -> Self
pub fn marker(self, v: Marker) -> Self
Glyph family used for dot drawing (default Marker::Braille).
Sourcepub fn legend(self, v: bool) -> Self
pub fn legend(self, v: bool) -> Self
Series-name legend on the bottom row (default on, shown when it fits).
Hide series by index; they stay in the legend so they can be toggled
back, see Interaction.
Trait Implementations§
Source§impl<'a> Clone for RadarChart<'a>
impl<'a> Clone for RadarChart<'a>
Source§impl<'a> Debug for RadarChart<'a>
impl<'a> Debug for RadarChart<'a>
Source§impl<'a> Themed for RadarChart<'a>
Available on crate feature theme only.
impl<'a> Themed for RadarChart<'a>
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 &RadarChart<'_>
impl Widget for &RadarChart<'_>
Auto Trait Implementations§
impl<'a> Forget for RadarChart<'a>
impl<'a> Freeze for RadarChart<'a>
impl<'a> RefUnwindSafe for RadarChart<'a>
impl<'a> Send for RadarChart<'a>
impl<'a> Sync for RadarChart<'a>
impl<'a> Unpin for RadarChart<'a>
impl<'a> UnsafeUnpin for RadarChart<'a>
impl<'a> UnwindSafe for RadarChart<'a>
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