pub struct ChartWidget { /* private fields */ }Expand description
Fluent builder for a dashboard chart widget (bar, area, or horizontal breakdown).
Implementations§
Source§impl ChartWidget
impl ChartWidget
Sourcepub fn new(
id: impl Into<String>,
title: impl Into<String>,
style: ChartStyle,
) -> Self
pub fn new( id: impl Into<String>, title: impl Into<String>, style: ChartStyle, ) -> Self
A chart with an id that is unique on the dashboard, a title, and a style. It spans two
of the dashboard’s four columns unless you set col_span.
Sourcepub fn subtitle(self, subtitle: impl Into<String>) -> Self
pub fn subtitle(self, subtitle: impl Into<String>) -> Self
Adds a line under the chart’s title.
Sourcepub fn point(self, label: impl Into<String>, value: f64) -> Self
pub fn point(self, label: impl Into<String>, value: f64) -> Self
Adds a point, drawn in the chart’s main color. Points are drawn in the order you add them.
Sourcepub fn colored_point(
self,
label: impl Into<String>,
value: f64,
color: BadgeColor,
) -> Self
pub fn colored_point( self, label: impl Into<String>, value: f64, color: BadgeColor, ) -> Self
Adds a point with a color of its own, for a breakdown such as orders by status.
Sourcepub fn prefix(self, prefix: impl Into<String>) -> Self
pub fn prefix(self, prefix: impl Into<String>) -> Self
Sets text shown before each value, such as $.
Sourcepub fn suffix(self, suffix: impl Into<String>) -> Self
pub fn suffix(self, suffix: impl Into<String>) -> Self
Sets text shown after each value, such as %.
Sourcepub fn col_span(self, span: u8) -> Self
pub fn col_span(self, span: u8) -> Self
Sets how many of the dashboard’s four columns the chart spans.
Sourcepub fn build(self) -> DashboardWidgetDto
pub fn build(self) -> DashboardWidgetDto
Finishes the widget.
Trait Implementations§
Source§impl Clone for ChartWidget
impl Clone for ChartWidget
Source§impl Debug for ChartWidget
impl Debug for ChartWidget
Source§impl From<ChartWidget> for DashboardWidgetDto
impl From<ChartWidget> for DashboardWidgetDto
Source§fn from(widget: ChartWidget) -> Self
fn from(widget: ChartWidget) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Forget for ChartWidget
impl Freeze for ChartWidget
impl Move for ChartWidget
impl RefUnwindSafe for ChartWidget
impl Send for ChartWidgetwhere
RawVecInner: Send,
impl Sync for ChartWidgetwhere
RawVecInner: Sync,
impl Unpin for ChartWidget
impl UnsafeUnpin for ChartWidgetwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<ChartPointDto>: UnsafeUnpin,
impl UnwindSafe for ChartWidgetwhere
RawVecInner: UnwindSafe,
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<K> ForeignKey<K> for K
impl<K> ForeignKey<K> for K
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
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