pub struct RoseChart { /* private fields */ }Expand description
Rose chart widget.
§Example
use ratatui::{buffer::Buffer, layout::Rect, widgets::Widget};
use tui_chart::{RoseChart, RoseItem};
let chart = RoseChart::new([RoseItem::new("N", 4.0), RoseItem::new("E", 9.0), RoseItem::new("S", 2.0)]);
let area = Rect::new(0, 0, 40, 12);
let mut buf = Buffer::empty(area);
chart.render(area, &mut buf);Implementations§
Source§impl RoseChart
impl RoseChart
Sourcepub fn new(items: impl IntoIterator<Item = RoseItem>) -> Self
pub fn new(items: impl IntoIterator<Item = RoseItem>) -> Self
Create a chart.
Sourcepub fn area_scale(self, v: bool) -> Self
pub fn area_scale(self, v: bool) -> Self
Radius ∝ √value so sector area is proportional to value
(default); false makes the radius linear in value.
Sourcepub fn start_deg(self, v: f64) -> Self
pub fn start_deg(self, v: f64) -> Self
Angle of the first sector’s start, degrees clockwise from the top.
Sourcepub fn inner(self, v: f64) -> Self
pub fn inner(self, v: f64) -> Self
Hole radius as a fraction of the outer radius, 0.0..0.9 (default 0).
Sourcepub fn show_labels(self, v: bool) -> Self
pub fn show_labels(self, v: bool) -> Self
Draw sector labels around the chart (default on).
Sourcepub fn show_values(self, v: bool) -> Self
pub fn show_values(self, v: bool) -> Self
Append the value to the labels (default on).
Sourcepub fn marker(self, v: Marker) -> Self
pub fn marker(self, v: Marker) -> Self
Dot resolution (default braille; half blocks fill solid but are coarser).
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 Themed for RoseChart
Available on crate feature theme only.
impl Themed for RoseChart
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.Auto Trait Implementations§
impl Freeze for RoseChart
impl RefUnwindSafe for RoseChart
impl Send for RoseChart
impl Sync for RoseChart
impl Unpin for RoseChart
impl UnsafeUnpin for RoseChart
impl UnwindSafe for RoseChart
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