pub struct Pie {
pub segs: Vec<PieSegment>,
pub title: String,
pub radius: f64,
}
Expand description
use graplot::Pie;
// without labels: let pie = Pie::new([35., 25., 25., 15.]);
let draw = [(35., "label"), (25., "len"), (25., "labeled"), (15., "test")];
let mut pie = Pie::new(draw);
pie.set_title("title");
pie.show();
Fields§
§segs: Vec<PieSegment>
§title: String
§radius: f64
Implementations§
source§impl Pie
impl Pie
sourcepub fn set_radius(&mut self, radius: f64)
pub fn set_radius(&mut self, radius: f64)
sets the radius of the final circle. Default radius: 110.0
pub fn set_title(&mut self, title: &str)
sourcepub fn color(&mut self, idx: usize, color: Color)
pub fn color(&mut self, idx: usize, color: Color)
Colors the segment at the given index with the color. /// # Example
use graplot::{Pie, Color};
let mut pie = Pie::new([25., 20., 15., 15., 35.]);
pie.color(1, Color::new(0.2, 0.1, 0.3, 1.));
pie.show();