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
sourceimpl Bar
impl Bar
pub fn new<A: BarDescArg>(xs: A, ys: &[f64]) -> Bar
pub fn set_title(&mut self, title: &str)
pub fn set_xlabel(&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();
pub fn add<A: BarDescArg>(&mut self, bar: A, y: f64)
pub fn show(self)
Auto Trait Implementations
impl RefUnwindSafe for Bar
impl Send for Bar
impl Sync for Bar
impl Unpin for Bar
impl UnwindSafe for Bar
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more