pub struct Bar {
pub bars: Vec<BarDesc>,
pub ys: Vec<f64>,
pub axis_desc: AxisDesc,
pub desc: Desc,
}
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();
Fields§
§bars: Vec<BarDesc>
§ys: Vec<f64>
§axis_desc: AxisDesc
§desc: Desc
Implementations§
Source§impl Bar
impl Bar
Sourcepub fn new<A: BarDescArg>(xs: A, ys: &[f64]) -> Bar
pub fn new<A: BarDescArg>(xs: A, ys: &[f64]) -> Bar
Examples found in repository?
More examples
Sourcepub fn set_title(&mut self, title: &str)
pub fn set_title(&mut self, title: &str)
Examples found in repository?
More examples
Sourcepub fn set_xlabel(&mut self, label: &str)
pub fn set_xlabel(&mut self, label: &str)
Sourcepub fn set_ylabel(&mut self, label: &str)
pub fn set_ylabel(&mut self, label: &str)
Sourcepub fn color(&mut self, idx: usize, color: Color)
pub fn color(&mut self, idx: usize, color: Color)
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();
Sourcepub fn add<A: BarDescArg>(&mut self, bar: A, y: f64)
pub fn add<A: BarDescArg>(&mut self, bar: A, y: f64)
Sourcepub fn show(self)
pub fn show(self)
Examples found in repository?
More examples
Auto Trait Implementations§
impl Freeze for Bar
impl RefUnwindSafe for Bar
impl Send for Bar
impl Sync for Bar
impl Unpin for Bar
impl UnwindSafe for Bar
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