Expand description
use graplot::Bar;
let mut bar = Bar::new(["Ferris", "Stefan", "Test"], &[100., 200., 700.]);
bar.set_title("title");
bar.set_xlabel("test");
bar.show();
3
4
5
6
7
8
fn main() {
let mut bar = Bar::new(["Ferris", "Stefan", "Test"], &[100., 200., 700.]);
bar.set_title("title");
bar.set_xlabel("test");
bar.show();
}
More examples
Hide additional examples
examples/bar_colored.rs (
line 4)
3
4
5
6
7
8
9
fn main() {
let mut bar = Bar::new([("Ferris", RED), ("Stefan", GREEN), ("Test", BLUE)], &[100., 200., 500.,]);
bar.add(("Added", ORANGE), 400.);
bar.set_title("title");
bar.set_ylabel("test");
bar.show();
}
3
4
5
6
7
8
fn main() {
let mut bar = Bar::new(["Ferris", "Stefan", "Test"], &[100., 200., 700.]);
bar.set_title("title");
bar.set_xlabel("test");
bar.show();
}
More examples
Hide additional examples
examples/bar_colored.rs (
line 6)
3
4
5
6
7
8
9
fn main() {
let mut bar = Bar::new([("Ferris", RED), ("Stefan", GREEN), ("Test", BLUE)], &[100., 200., 500.,]);
bar.add(("Added", ORANGE), 400.);
bar.set_title("title");
bar.set_ylabel("test");
bar.show();
}
3
4
5
6
7
8
fn main() {
let mut bar = Bar::new(["Ferris", "Stefan", "Test"], &[100., 200., 700.]);
bar.set_title("title");
bar.set_xlabel("test");
bar.show();
}
examples/bar_colored.rs (
line 7)
3
4
5
6
7
8
9
fn main() {
let mut bar = Bar::new([("Ferris", RED), ("Stefan", GREEN), ("Test", BLUE)], &[100., 200., 500.,]);
bar.add(("Added", ORANGE), 400.);
bar.set_title("title");
bar.set_ylabel("test");
bar.show();
}
Colors the bar at the given index with the color.
use graplot::{Bar, Color};
let mut bar = Bar::new(["Red", "Green", "Blue"], &[200., 220., 250.]);
bar.color(0, Color::new(1., 0., 0., 1.,));
bar.color(2, Color::new(0., 0., 1., 1.,));
bar.show();
examples/bar_colored.rs (
line 5)
3
4
5
6
7
8
9
fn main() {
let mut bar = Bar::new([("Ferris", RED), ("Stefan", GREEN), ("Test", BLUE)], &[100., 200., 500.,]);
bar.add(("Added", ORANGE), 400.);
bar.set_title("title");
bar.set_ylabel("test");
bar.show();
}
3
4
5
6
7
8
fn main() {
let mut bar = Bar::new(["Ferris", "Stefan", "Test"], &[100., 200., 700.]);
bar.set_title("title");
bar.set_xlabel("test");
bar.show();
}
More examples
Hide additional examples
examples/bar_colored.rs (
line 8)
3
4
5
6
7
8
9
fn main() {
let mut bar = Bar::new([("Ferris", RED), ("Stefan", GREEN), ("Test", BLUE)], &[100., 200., 500.,]);
bar.add(("Added", ORANGE), 400.);
bar.set_title("title");
bar.set_ylabel("test");
bar.show();
}
Immutably borrows from an owned value.
Read more
Mutably borrows from an owned value.
Read more
Returns the argument unchanged.
Calls U::from(self)
.
That is, this conversion is whatever the implementation of
From<T> for U
chooses to do.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.