pub struct Pie<'a, Coord, Label: Display> { /* private fields */ }
Expand description

A Pie Graph

Implementations

Build a Pie object. Assumes a start angle at 0.0, which is aligned to the horizontal axis.

Pass an angle in degrees to change the default. Default is set to start at 0, which is aligned on the x axis.

use plotters::prelude::*;
let mut pie = Pie::new(&(50,50), &10.0, &[50.0, 25.25, 20.0, 5.5], &[RED, BLUE, GREEN, WHITE], &["Red", "Blue", "Green", "White"]);
pie.start_angle(-90.0);  // retract to a right angle, so it starts aligned to a vertical Y axis.

Sets the offset to labels, to distanciate them further/closer from the center.

enables drawing the wedge’s percentage in the middle of the wedge, with the given style

Trait Implementations

Actually draws the element. The key points is already translated into the image coordinate and can be used by DC directly Read more

The item in point iterator

The point iterator

framework to do the coordinate mapping

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

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.