pub struct ChartCard<V> { /* private fields */ }Expand description
A chart’s card: its title and description, what changes it, and what it says at the bottom, such as how it compares to last month.
use ravenrs_widgets::{Chart, ChartCard, ChartKind, IconName};
let card = ChartCard::new(Chart::new(ChartKind::Bar))
.title("Sales")
.description("January to June")
.trend("Up by 5.2% this month", IconName::TrendingUp)
.note("Showing all channels");Implementations§
Source§impl<V: View> ChartCard<V>
impl<V: View> ChartCard<V>
Sourcepub fn description(self, description: impl Into<String>) -> Self
pub fn description(self, description: impl Into<String>) -> Self
What the chart shows, under the title.
Sourcepub fn action(self, action: impl View + 'static) -> Self
pub fn action(self, action: impl View + 'static) -> Self
Something beside the title that changes the chart, such as a period.
Sourcepub fn tabs(
self,
selected: Binding<usize>,
tabs: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>,
) -> Self
pub fn tabs( self, selected: Binding<usize>, tabs: impl IntoIterator<Item = (impl Into<String>, impl Into<String>)>, ) -> Self
Choices beside the title, each with a big number: what to show, and how much it is.
Trait Implementations§
Auto Trait Implementations§
impl<V> !RefUnwindSafe for ChartCard<V>
impl<V> !Send for ChartCard<V>
impl<V> !Sync for ChartCard<V>
impl<V> !UnwindSafe for ChartCard<V>
impl<V> Freeze for ChartCard<V>where
V: Freeze,
impl<V> Unpin for ChartCard<V>where
V: Unpin,
impl<V> UnsafeUnpin for ChartCard<V>where
V: UnsafeUnpin,
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
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<V> ViewExt for Vwhere
V: View,
impl<V> ViewExt for Vwhere
V: View,
Source§fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
fn padding(self, padding: impl Into<Insets>) -> Styled<Self>
Adds padding inside the box, in logical pixels.
Source§fn background(self, fill: impl Into<Fill>) -> Styled<Self>
fn background(self, fill: impl Into<Fill>) -> Styled<Self>
Paints a background behind the content.
Source§fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
fn frame(self, width: Option<f32>, height: Option<f32>) -> Styled<Self>
Fixes the width and/or height in logical pixels;
None keeps the content size.