Struct BoxStyle

Source
pub struct BoxStyle { /* private fields */ }

Implementations§

Source§

impl BoxStyle

Source

pub fn new() -> Self

Examples found in repository?
examples/histogram_svg.rs (line 9)
6fn main() {
7    let data = [0.3, 0.5, 6.4, 5.3, 3.6, 3.6, 3.5, 7.5, 4.0];
8    let h = Histogram::from_slice(&data, HistogramBins::Count(10))
9        .style(&BoxStyle::new().fill("burlywood"));
10
11    let v = ContinuousView::new().add(h);
12
13    Page::single(&v).save("histogram.svg").expect("saving svg");
14}
More examples
Hide additional examples
examples/barchart_svg.rs (line 10)
6fn main() {
7    let b1 = BarChart::new(5.3).label("1");
8    let b2 = BarChart::new(2.6)
9        .label("2")
10        .style(&BoxStyle::new().fill("darkolivegreen"));
11
12    let v = CategoricalView::new().add(b1).add(b2).x_label("Experiment");
13
14    Page::single(&v).save("barchart.svg").expect("saving svg");
15}
examples/with_grid.rs (line 32)
25fn render_barchart<S>(filename: S)
26where
27    S: AsRef<str>,
28{
29    let b1 = BarChart::new(5.3).label("1");
30    let b2 = BarChart::new(2.6)
31        .label("2")
32        .style(&BoxStyle::new().fill("darkolivegreen"));
33    let mut v = CategoricalView::new().add(b1).add(b2).x_label("Experiment");
34    v.add_grid(Grid::new(3, 8));
35    Page::single(&v)
36        .save(filename.as_ref())
37        .expect("saving svg");
38}
examples/boxplot_svg.rs (line 10)
6fn main() {
7    let b1 = BoxPlot::from_slice(&[1.0, 4.0, 2.0, 3.5, 6.4, 2.5, 7.5, 1.8, 9.6]).label("1");
8    let b2 = BoxPlot::from_slice(&[3.0, 4.3, 2.0, 3.5, 6.9, 4.5, 7.5, 1.8, 10.6])
9        .label("2")
10        .style(&BoxStyle::new().fill("darkolivegreen"));
11
12    let v = CategoricalView::new()
13        .add(b1)
14        .add(b2)
15        .x_label("Experiment")
16        .y_label("y");
17
18    Page::single(&v)
19        .dimensions(400, 300)
20        .save("boxplot.svg")
21        .expect("saving svg");
22}
Source

pub fn overlay(&mut self, other: &Self)

Source

pub fn fill<T>(self, value: T) -> Self
where T: Into<String>,

Examples found in repository?
examples/histogram_svg.rs (line 9)
6fn main() {
7    let data = [0.3, 0.5, 6.4, 5.3, 3.6, 3.6, 3.5, 7.5, 4.0];
8    let h = Histogram::from_slice(&data, HistogramBins::Count(10))
9        .style(&BoxStyle::new().fill("burlywood"));
10
11    let v = ContinuousView::new().add(h);
12
13    Page::single(&v).save("histogram.svg").expect("saving svg");
14}
More examples
Hide additional examples
examples/barchart_svg.rs (line 10)
6fn main() {
7    let b1 = BarChart::new(5.3).label("1");
8    let b2 = BarChart::new(2.6)
9        .label("2")
10        .style(&BoxStyle::new().fill("darkolivegreen"));
11
12    let v = CategoricalView::new().add(b1).add(b2).x_label("Experiment");
13
14    Page::single(&v).save("barchart.svg").expect("saving svg");
15}
examples/with_grid.rs (line 32)
25fn render_barchart<S>(filename: S)
26where
27    S: AsRef<str>,
28{
29    let b1 = BarChart::new(5.3).label("1");
30    let b2 = BarChart::new(2.6)
31        .label("2")
32        .style(&BoxStyle::new().fill("darkolivegreen"));
33    let mut v = CategoricalView::new().add(b1).add(b2).x_label("Experiment");
34    v.add_grid(Grid::new(3, 8));
35    Page::single(&v)
36        .save(filename.as_ref())
37        .expect("saving svg");
38}
examples/boxplot_svg.rs (line 10)
6fn main() {
7    let b1 = BoxPlot::from_slice(&[1.0, 4.0, 2.0, 3.5, 6.4, 2.5, 7.5, 1.8, 9.6]).label("1");
8    let b2 = BoxPlot::from_slice(&[3.0, 4.3, 2.0, 3.5, 6.9, 4.5, 7.5, 1.8, 10.6])
9        .label("2")
10        .style(&BoxStyle::new().fill("darkolivegreen"));
11
12    let v = CategoricalView::new()
13        .add(b1)
14        .add(b2)
15        .x_label("Experiment")
16        .y_label("y");
17
18    Page::single(&v)
19        .dimensions(400, 300)
20        .save("boxplot.svg")
21        .expect("saving svg");
22}
Source

pub fn get_fill(&self) -> String

Trait Implementations§

Source§

impl Debug for BoxStyle

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for BoxStyle

Source§

fn default() -> BoxStyle

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.