pub struct BarOpts { /* private fields */ }Implementations§
Source§impl BarOpts
impl BarOpts
Sourcepub fn label(self, s: impl Into<String>) -> Self
pub fn label(self, s: impl Into<String>) -> Self
Examples found in repository?
examples/gen_hero_svgs.rs (line 96)
88fn bar() -> String {
89 let cats = ["A", "B", "C", "D"];
90 Figure::new()
91 .size(PaperSize::A5Landscape)
92 .title("Test bench results")
93 .xlabel("specimen")
94 .ylabel("yield (MPa)")
95 .bar(&cats, &[320.0, 290.0, 410.0, 355.0], |b| {
96 b.label("trial 1").hatch(Hatch::Diagonal).group(0)
97 })
98 .bar(&cats, &[345.0, 305.0, 395.0, 380.0], |b| {
99 b.label("trial 2").hatch(Hatch::Crosshatch).group(1)
100 })
101 .legend_top_left()
102 .to_svg()
103}More examples
examples/bar_grouped.rs (line 12)
3fn main() {
4 let cats = ["A", "B", "C", "D"];
5
6 let fig = Figure::new()
7 .size(PaperSize::A5Landscape)
8 .title("Test bench results")
9 .xlabel("specimen")
10 .ylabel("yield (MPa)")
11 .bar(&cats, &[320.0, 290.0, 410.0, 355.0], |b| {
12 b.label("trial 1").hatch(Hatch::Diagonal).group(0)
13 })
14 .bar(&cats, &[345.0, 305.0, 395.0, 380.0], |b| {
15 b.label("trial 2").hatch(Hatch::Crosshatch).group(1)
16 })
17 .legend_top_left();
18
19 std::fs::create_dir_all("out").expect("create out/");
20 std::fs::write("out/bar_grouped.svg", fig.to_svg()).expect("write svg");
21 println!("wrote out/bar_grouped.svg");
22}Sourcepub fn hatch(self, h: Hatch) -> Self
pub fn hatch(self, h: Hatch) -> Self
Examples found in repository?
examples/gen_hero_svgs.rs (line 96)
88fn bar() -> String {
89 let cats = ["A", "B", "C", "D"];
90 Figure::new()
91 .size(PaperSize::A5Landscape)
92 .title("Test bench results")
93 .xlabel("specimen")
94 .ylabel("yield (MPa)")
95 .bar(&cats, &[320.0, 290.0, 410.0, 355.0], |b| {
96 b.label("trial 1").hatch(Hatch::Diagonal).group(0)
97 })
98 .bar(&cats, &[345.0, 305.0, 395.0, 380.0], |b| {
99 b.label("trial 2").hatch(Hatch::Crosshatch).group(1)
100 })
101 .legend_top_left()
102 .to_svg()
103}More examples
examples/bar_grouped.rs (line 12)
3fn main() {
4 let cats = ["A", "B", "C", "D"];
5
6 let fig = Figure::new()
7 .size(PaperSize::A5Landscape)
8 .title("Test bench results")
9 .xlabel("specimen")
10 .ylabel("yield (MPa)")
11 .bar(&cats, &[320.0, 290.0, 410.0, 355.0], |b| {
12 b.label("trial 1").hatch(Hatch::Diagonal).group(0)
13 })
14 .bar(&cats, &[345.0, 305.0, 395.0, 380.0], |b| {
15 b.label("trial 2").hatch(Hatch::Crosshatch).group(1)
16 })
17 .legend_top_left();
18
19 std::fs::create_dir_all("out").expect("create out/");
20 std::fs::write("out/bar_grouped.svg", fig.to_svg()).expect("write svg");
21 println!("wrote out/bar_grouped.svg");
22}Sourcepub fn group(self, g: u32) -> Self
pub fn group(self, g: u32) -> Self
Examples found in repository?
examples/gen_hero_svgs.rs (line 96)
88fn bar() -> String {
89 let cats = ["A", "B", "C", "D"];
90 Figure::new()
91 .size(PaperSize::A5Landscape)
92 .title("Test bench results")
93 .xlabel("specimen")
94 .ylabel("yield (MPa)")
95 .bar(&cats, &[320.0, 290.0, 410.0, 355.0], |b| {
96 b.label("trial 1").hatch(Hatch::Diagonal).group(0)
97 })
98 .bar(&cats, &[345.0, 305.0, 395.0, 380.0], |b| {
99 b.label("trial 2").hatch(Hatch::Crosshatch).group(1)
100 })
101 .legend_top_left()
102 .to_svg()
103}More examples
examples/bar_grouped.rs (line 12)
3fn main() {
4 let cats = ["A", "B", "C", "D"];
5
6 let fig = Figure::new()
7 .size(PaperSize::A5Landscape)
8 .title("Test bench results")
9 .xlabel("specimen")
10 .ylabel("yield (MPa)")
11 .bar(&cats, &[320.0, 290.0, 410.0, 355.0], |b| {
12 b.label("trial 1").hatch(Hatch::Diagonal).group(0)
13 })
14 .bar(&cats, &[345.0, 305.0, 395.0, 380.0], |b| {
15 b.label("trial 2").hatch(Hatch::Crosshatch).group(1)
16 })
17 .legend_top_left();
18
19 std::fs::create_dir_all("out").expect("create out/");
20 std::fs::write("out/bar_grouped.svg", fig.to_svg()).expect("write svg");
21 println!("wrote out/bar_grouped.svg");
22}pub fn stroke_width(self, w: f64) -> Self
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BarOpts
impl RefUnwindSafe for BarOpts
impl Send for BarOpts
impl Sync for BarOpts
impl Unpin for BarOpts
impl UnsafeUnpin for BarOpts
impl UnwindSafe for BarOpts
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