pub struct Chart { /* private fields */ }Expand description
A chart for a Widget’s body: a heading, labels along the bottom, such as
months, and one Series of values per thing it measures. chart draws it.
Chart::bar(["Jan", "Feb", "Mar"])
.heading("Orders")
.description("Placed and refunded, per month")
.series(Series::new("Placed", [120.0, 98.0, 143.0]))
.series(Series::new("Refunded", [4.0, 7.0, 2.0]).color(Color::Danger));A chart over a resource’s records reads them as a widget reads any: it asks
can_list first and reads through scoped_query.
Implementations§
Source§impl Chart
impl Chart
Sourcepub fn line(labels: impl IntoIterator<Item = impl Into<Text>>) -> Self
pub fn line(labels: impl IntoIterator<Item = impl Into<Text>>) -> Self
A line chart over labels, oldest first when they are dates.
Sourcepub fn bar(labels: impl IntoIterator<Item = impl Into<Text>>) -> Self
pub fn bar(labels: impl IntoIterator<Item = impl Into<Text>>) -> Self
A bar chart over labels.
Sourcepub fn heading(self, heading: impl Into<Text>) -> Self
pub fn heading(self, heading: impl Into<Text>) -> Self
The title above the chart, which also captions its data table.
Sourcepub fn description(self, description: impl Into<Text>) -> Self
pub fn description(self, description: impl Into<Text>) -> Self
The line under the heading, such as the period the chart covers.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Chart
impl Freeze for Chart
impl RefUnwindSafe for Chart
impl Send for Chart
impl Sync for Chart
impl Unpin for Chart
impl UnsafeUnpin for Chart
impl UnwindSafe for Chart
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