pub struct Chart {
pub kind: Kind,
pub title: Option<String>,
pub labels: Vec<String>,
pub series: Vec<Series>,
pub palette: Palette,
pub legend: Legend,
pub x: Axis,
pub y: Axis,
pub right: Option<Axis>,
pub aspect_ratio: Option<f64>,
/* private fields */
}Expand description
A chart, as a builder.
Fields§
§kind: Kind§title: Option<String>§labels: Vec<String>§series: Vec<Series>§palette: Palette§legend: Legend§x: Axis§y: Axis§right: Option<Axis>A second value axis on the right, for a series in another unit.
aspect_ratio: Option<f64>Let the canvas take the height its container gives it.
Implementations§
Source§impl Chart
impl Chart
pub fn new(kind: Kind) -> Chart
pub fn line(title: impl Into<String>) -> Chart
pub fn bar(title: impl Into<String>) -> Chart
pub fn horizontal_bar(title: impl Into<String>) -> Chart
pub fn doughnut(title: impl Into<String>) -> Chart
pub fn pie(title: impl Into<String>) -> Chart
Sourcepub fn scatter(
title: impl Into<String>,
label: impl Into<String>,
points: impl IntoIterator<Item = (f64, f64)>,
) -> Chart
pub fn scatter( title: impl Into<String>, label: impl Into<String>, points: impl IntoIterator<Item = (f64, f64)>, ) -> Chart
Points in two dimensions, which have no category labels at all.
pub fn title(self, title: impl Into<String>) -> Chart
Sourcepub fn untitled(self) -> Chart
pub fn untitled(self) -> Chart
Drop the title from the chart itself — for a card whose heading already says it, so a screen reader does not read it twice.
pub fn labels( self, labels: impl IntoIterator<Item = impl Into<String>>, ) -> Chart
pub fn series(self, series: Series) -> Chart
Sourcepub fn values(
self,
label: impl Into<String>,
values: impl IntoIterator<Item = f64>,
) -> Chart
pub fn values( self, label: impl Into<String>, values: impl IntoIterator<Item = f64>, ) -> Chart
A single unnamed run — the common case for a doughnut or a sparkline.
pub fn palette(self, palette: Palette) -> Chart
pub fn legend(self, legend: Legend) -> Chart
pub fn x(self, axis: Axis) -> Chart
pub fn y(self, axis: Axis) -> Chart
Sourcepub fn right(self, axis: Axis) -> Chart
pub fn right(self, axis: Axis) -> Chart
A second value axis on the right, for Series::right_axis.
pub fn aspect_ratio(self, ratio: f64) -> Chart
Trait Implementations§
impl StructuralPartialEq for Chart
Auto Trait Implementations§
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